Skip to content

Commit 2e873f7

Browse files
[3.14] gh-86726: Fix the documented return type of tkinter info_patchlevel() (GH-151655) (GH-151659)
It returns a sys.version_info-like named tuple, not a string. (cherry picked from commit 3cd02a1) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1141d29 commit 2e873f7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Doc/library/tkinter.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2307,7 +2307,13 @@ Base and mixin classes
23072307

23082308
.. method:: info_patchlevel()
23092309

2310-
Return the Tcl/Tk patch level as a string, for example ``'8.6.15'``.
2310+
Return the Tcl/Tk patch level as a named tuple with the same five fields
2311+
as :data:`sys.version_info`: *major*, *minor*, *micro*, *releaselevel*
2312+
and *serial*.
2313+
*releaselevel* is ``'alpha'``, ``'beta'`` or ``'final'``.
2314+
Converting it to a string gives the version in the usual Tcl/Tk notation,
2315+
for example ``'9.0.3'`` for a final release or ``'9.1b2'`` for a
2316+
pre-release.
23112317

23122318
.. versionadded:: 3.11
23132319

0 commit comments

Comments
 (0)