Add method for getting the exact version of the Tcl library as a named tuple · Issue #91827 · python/cpython (original) (raw)
Global variables TkVersion
and TclVersion
contain the version as a float, e.g. 8.6
. There are several issues with this:
- It is a float. Therefore it cannot work with minor version larger than 9.
- It does not contain important information about serial (bugfix) number and release level (alpha/beta/final). New features were added in Tcl/Tk with changing the third version number. The bugfix number can also affect workaround for bugs.
- It gives the version of the Tcl headers with which
tkinter
was built. But if Tcl versions are binary compatible, the real dynamic version can be different.
More detailed info can be retrieved by Tcl command info patchlevel
. But the interface of calling raw Tcl commands is not official, and the result is a string, which is hard to compare as version.
I propose to add new method info_patchlevel()
which returns the exact version of the Tcl library as a named tuple similar to sys.version_info
.
The question is whether we need a global variable representing the static version as a named tuple (it is known at compile time) and what should be its name.