[Python-checkins] CVS: python/dist/src/Doc/lib libsys.tex,1.33,1.34

Fred Drake python-dev@python.org
2000年4月13日 12:54:20 -0400


Update of /projects/cvsroot/python/dist/src/Doc/lib
In directory seahag.cnri.reston.va.us:/home/fdrake/projects/python/Doc/lib
Modified Files:
	libsys.tex 
Log Message:
Document hexversion (incompletely explained) and version_info (easily
explained).
Index: libsys.tex
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Doc/lib/libsys.tex,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** libsys.tex	2000年04月11日 19:46:40	1.33
--- libsys.tex	2000年04月13日 16:54:17	1.34
***************
*** 139,142 ****
--- 139,164 ----
 \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}
***************
*** 303,306 ****
--- 325,338 ----
 '1.5.2 (#0 Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)]'
 \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}
 

AltStyle によって変換されたページ (->オリジナル) /