]> granicus.if.org Git - python/commitdiff
#11901: add description of how bitfields are laid out to hexversion docs
authorR David Murray <rdmurray@bitdance.com>
Mon, 25 Apr 2011 20:12:26 +0000 (16:12 -0400)
committerR David Murray <rdmurray@bitdance.com>
Mon, 25 Apr 2011 20:12:26 +0000 (16:12 -0400)
Patch by Sijin Joseph.

Doc/library/sys.rst
Misc/ACKS

index e51e8eaba8396f926d9027614f7d66f1376bdc82..148630cceefde15747913afaacd575c577254983 100644 (file)
@@ -450,6 +450,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
 
index 7842fa24a95759c07c4841df8659a7c140e3bd86..75ad0f984680a46c75e6e837d74f1734eb6c74f9 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -411,6 +411,7 @@ Irmen de Jong
 Lucas de Jonge
 John Jorgensen
 Jens B. Jorgensen
+Sijin Joseph
 Andreas Jung
 Tattoo Mabonzo K.
 Bob Kahn