Skip to content

Commit 593e473

Browse files
serhiy-storchakaclaude
authored andcommitted
gh-86726: Fix the documented return type of tkinter info_patchlevel() (GH-151655)
It returns a sys.version_info-like named tuple, not a string. (cherry picked from commit 3cd02a1) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0125168 commit 593e473

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
@@ -2333,7 +2333,13 @@ Base and mixin classes
23332333

23342334
.. method:: info_patchlevel()
23352335

2336-
Return the Tcl/Tk patch level as a string, for example ``'9.1.0'``.
2336+
Return the Tcl/Tk patch level as a named tuple with the same five fields
2337+
as :data:`sys.version_info`: *major*, *minor*, *micro*, *releaselevel*
2338+
and *serial*.
2339+
*releaselevel* is ``'alpha'``, ``'beta'`` or ``'final'``.
2340+
Converting it to a string gives the version in the usual Tcl/Tk notation,
2341+
for example ``'9.0.3'`` for a final release or ``'9.1b2'`` for a
2342+
pre-release.
23372343

23382344
.. versionadded:: 3.11
23392345

0 commit comments

Comments
 (0)