diff options
author | Fred Drake <fdrake@acm.org> | 2000-04-13 16:54:17 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-04-13 16:54:17 (GMT) |
commit | 4d65d73686fa535c2f4ce4047f82bf0d7255d46c (patch) | |
tree | d1e630e3ac791a02818b1de2ba1bc8d0550d87b8 /Doc/lib/libsys.tex | |
parent | 801c08d700c16296dccd8f9fa31979d3ed052751 (diff) | |
download | cpython-4d65d73686fa535c2f4ce4047f82bf0d7255d46c.zip cpython-4d65d73686fa535c2f4ce4047f82bf0d7255d46c.tar.gz cpython-4d65d73686fa535c2f4ce4047f82bf0d7255d46c.tar.bz2 |
Document hexversion (incompletely explained) and version_info (easily
explained).
Diffstat (limited to 'Doc/lib/libsys.tex')
-rw-r--r-- | Doc/lib/libsys.tex | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Doc/lib/libsys.tex b/Doc/lib/libsys.tex index a92201c..1beb53c 100644 --- a/Doc/lib/libsys.tex +++ b/Doc/lib/libsys.tex @@ -138,6 +138,28 @@ generally one higher than you might expect, because it includes the (temporary) reference as an argument to \function{getrefcount()}. \end{funcdesc} +\begin{datadesc}{hexversion} +The version number encoded as a single integer. This is guaranteed to +increase with each version, including proper support for +non-production releases. For example, to test that the Python +interpreter is at least version 1.5.2, use: + +\begin{verbatim} +if sys.hexversion >= 0x010502F0: + # use some advanced feature + ... +else: + # use an alternative implementation or warn the user + ... +\end{verbatim} + +This is called \samp{hexversion} since it only really looks meaningful +when viewed as the result of passing it to the built-in +\function{hex()} function. The \code{version_info} value may be used +for a more human-friendly encoding of the same information. +\versionadded{1.5.2} +\end{datadesc} + \begin{datadesc}{last_type} \dataline{last_value} \dataline{last_traceback} @@ -304,6 +326,16 @@ directories (where appropriate on each platform). An example: \end{verbatim} \end{datadesc} +\begin{datadesc}{version_info} +A tuple containing the four components of the version number: +\var{major}, \var{minor}, \var{micro} as integers, and +\var{releaselevel} as a string. The \var{releaselevel} value will be +an empty string for a final release. The \code{version_info} value +corresponding to the \code{version} string shown above is +\code{(1, 5, 2, '')}. +\versionadded{1.6} +\end{datadesc} + \begin{datadesc}{winver} The version number used to form registry keys on Windows platforms. This is stored as string resource 1000 in the Python DLL. The value |