@@ -138,6 +138,28 @@ \section{\module{sys} ---
138138(temporary) reference as an argument to \function {getrefcount()}.
139139\end {funcdesc }
140140
141+ \begin {datadesc }{hexversion}
142+ The version number encoded as a single integer. This is guaranteed to
143+ increase with each version, including proper support for
144+ non-production releases. For example, to test that the Python
145+ interpreter is at least version 1.5.2, use:
146+
147+ \begin {verbatim }
148+ if sys.hexversion >= 0x010502F0:
149+ # use some advanced feature
150+ ...
151+ else:
152+ # use an alternative implementation or warn the user
153+ ...
154+ \end {verbatim }
155+
156+ This is called \samp {hexversion} since it only really looks meaningful
157+ when viewed as the result of passing it to the built-in
158+ \function {hex()} function. The \code {version_info} value may be used
159+ for a more human-friendly encoding of the same information.
160+ \versionadded {1.5.2}
161+ \end {datadesc }
162+
141163\begin {datadesc }{last_type}
142164\dataline {last_value}
143165\dataline {last_traceback}
@@ -304,6 +326,16 @@ \section{\module{sys} ---
304326\end {verbatim }
305327\end {datadesc }
306328
329+ \begin {datadesc }{version_info}
330+ A tuple containing the four components of the version number:
331+ \var {major}, \var {minor}, \var {micro} as integers, and
332+ \var {releaselevel} as a string. The \var {releaselevel} value will be
333+ an empty string for a final release. The \code {version_info} value
334+ corresponding to the \code {version} string shown above is
335+ \code {(1, 5, 2, '' )}.
336+ \versionadded {1.6}
337+ \end {datadesc }
338+
307339\begin {datadesc }{winver}
308340The version number used to form registry keys on Windows platforms.
309341This is stored as string resource 1000 in the Python DLL. The value
0 commit comments