summaryrefslogtreecommitdiffstats
path: root/Doc/library/sys.rst
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2011-04-25 20:14:26 (GMT)
committerR David Murray <rdmurray@bitdance.com>2011-04-25 20:14:26 (GMT)
commitdff18b0858a3433cc0aa457a43e63aad86900586 (patch)
treecb28d00f022d880f76e4449b34bfca0ef26c0351 /Doc/library/sys.rst
parentd4a2ff40d581011213be5831a2bfa3ce3f42cb7b (diff)
parent0fb5b398cddbf75a121b93680c8f9771f2e8499c (diff)
downloadcpython-dff18b0858a3433cc0aa457a43e63aad86900586.zip
cpython-dff18b0858a3433cc0aa457a43e63aad86900586.tar.gz
cpython-dff18b0858a3433cc0aa457a43e63aad86900586.tar.bz2
Merge #11901: add description of how bitfields are laid out to hexversion docs
Patch by Sijin Joseph.
Diffstat (limited to 'Doc/library/sys.rst')
-rw-r--r--Doc/library/sys.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 4b1f02e..4d99ae6 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -540,6 +540,29 @@ always available.
``version_info`` value may be used for a more human-friendly encoding of the
same information.
+ The ``hexversion`` is a 32-bit number with the following layout
+
+ +-------------------------+------------------------------------------------+
+ | bits (big endian order) | meaning |
+ +=========================+================================================+
+ | :const:`1-8` | ``PY_MAJOR_VERSION`` (the ``2`` in |
+ | | ``2.1.0a3``) |
+ +-------------------------+------------------------------------------------+
+ | :const:`9-16` | ``PY_MINOR_VERSION`` (the ``1`` in |
+ | | ``2.1.0a3``) |
+ +-------------------------+------------------------------------------------+
+ | :const:`17-24` | ``PY_MICRO_VERSION`` (the ``0`` in |
+ | | ``2.1.0a3``) |
+ +-------------------------+------------------------------------------------+
+ | :const:`25-28` | ``PY_RELEASE_LEVEL`` (``0xA`` for alpha, |
+ | | ``0xB`` for beta, ``0xC`` for gamma and |
+ | | ``0xF`` for final) |
+ +-------------------------+------------------------------------------------+
+ | :const:`29-32` | ``PY_RELEASE_SERIAL`` (the ``3`` in |
+ | | ``2.1.0a3``) |
+ +-------------------------+------------------------------------------------+
+
+ thus ``2.1.0a3`` is hexversion ``0x020100a3``
.. data:: int_info