多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
### 导航 - [索引](../genindex.xhtml "总目录") - [模块](../py-modindex.xhtml "Python 模块索引") | - [下一页](../distributing/index.xhtml "分发 Python 模块") | - [上一页](gcsupport.xhtml "使对象类型支持循环垃圾回收") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) » - zh\_CN 3.7.3 [文档](../index.xhtml) » - [Python/C API 参考手册](index.xhtml) » - $('.inline-search').show(0); | # API 和 ABI 版本管理 `PY_VERSION_HEX` 是Python的版本号的整数形式。 例如,如果 `PY_VERSION_HEX` 被置为 `0x030401a2`, 其包含的版本信息可以通过以下方式将其作为一个32位数字来处理: > 字节 > > 位数(大端字节序) > > 意义 > > `1` > > `1-8` > > `PY_MAJOR_VERSION` (`3.4.1a2` 中的``3``) > > `2` > > `9-16` > > `PY_MINOR_VERSION` (`3.4.1a2``中的``4`) > > `3` > > `17-24` > > `PY_MICRO_VERSION` (`3.4.1a2``中的``1`) > > `4` > > `25-28` > > `PY_RELEASE_LEVEL` (`0xA` 是 alpha版本, `0xB` 是 beta版本, `0xC` 发布的候选版本并且 `0xF` 是最终版本),在这个例子中这个版本是alpha版本。 > > `29-32` > > `PY_RELEASE_SERIAL` (`3.4.1a2``中的``2`,最终版本用0) Thus `3.4.1a2` is hexversion `0x030401a2`. 所有提到的宏都定义在 [Include/patchlevel.h](https://github.com/python/cpython/tree/3.7/Include/patchlevel.h) \[https://github.com/python/cpython/tree/3.7/Include/patchlevel.h\]。 ### 导航 - [索引](../genindex.xhtml "总目录") - [模块](../py-modindex.xhtml "Python 模块索引") | - [下一页](../distributing/index.xhtml "分发 Python 模块") | - [上一页](gcsupport.xhtml "使对象类型支持循环垃圾回收") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) » - zh\_CN 3.7.3 [文档](../index.xhtml) » - [Python/C API 参考手册](index.xhtml) » - $('.inline-search').show(0); | © [版权所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 软件基金会是一个非盈利组织。 [请捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [发现了问题](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 创建。