Керування версіями API та ABI¶
PY_VERSION_HEX is the Python version number encoded in a single integer.
For example if the PY_VERSION_HEX is set to 0x030401a2, the underlying
version information can be found by treating it as a 32 bit number in
the following manner:
Байти
Біти (великий порядок байтів)
Значення
1
1-8
PY_MAJOR_VERSION(the3in3.4.1a2)
2
9-16
PY_MINOR_VERSION(the4in3.4.1a2)
3
17-24
PY_MICRO_VERSION(the1in3.4.1a2)
4
25-28
PY_RELEASE_LEVEL(0xAfor alpha,0xBfor beta,0xCfor release candidate and0xFfor final), in this case it is alpha.
29-32
PY_RELEASE_SERIAL(the2in3.4.1a2, zero for final releases)
Thus 3.4.1a2 is hexversion 0x030401a2.
Усі вказані макроси визначено в Include/patchlevel.h.