API and ABI Versioning - Python 3.6.15 documentation 编辑
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:
Bytes
Bits (big endian order)
Meaning
1
1-8
PY_MAJOR_VERSION
(the3
in3.4.1a2
)
2
9-16
PY_MINOR_VERSION
(the4
in3.4.1a2
)
3
17-24
PY_MICRO_VERSION
(the1
in3.4.1a2
)
4
25-28
PY_RELEASE_LEVEL
(0xA
for alpha,0xB
for beta,0xC
for release candidate and0xF
for final), in this case it is alpha.
29-32
PY_RELEASE_SERIAL
(the2
in3.4.1a2
, zero for final releases)
Thus 3.4.1a2
is hexversion 0x030401a2
.
All the given macros are defined in Include/patchlevel.h.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论