# Adding Py\_PACK\_VERSION

**URL:** <https://discuss.python.org/t/adding-py-pack-version/58887>\
**Category:** C API\
**Created:** [July 22, 2024, 3:35pm UTC](https://discuss.python.org/t/adding-py-pack-version/58887 "2024-07-22T15:35:30Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![ruang](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ruang/32/22210_2.png) [@ruang](https://discuss.python.org/u/ruang)\
**Post date:** [October 31, 2024, 11:46am UTC](https://discuss.python.org/t/adding-py-pack-version/58887/14 "2024-10-31T11:46:15Z")

</div>

Sorry, I seem to be late. I was thinking about this problem today, and today I published the same proposaland. I actually prefer `Py_VERSION` for the name, which is concise enough. I looked at Peter implementation, and I personally think it should be implemented as a macro, refer to `KERNEL_VERSION` in Linux.

this’s my proposaland

> [@Can we make the API version more readable?](https://discuss.python.org/t/can-we-make-the-api-version-more-readable/69767):
>
> Actually, there’s been an issue that has been bothering me, why not use macros to represent Python version? Using raw hexadecimal numbers seems a bit odd, even though it doesn’t affect functionality. I think it might be beneficial to add a macro similar to KERNEL\_VERSION to represent a Python version. This would make the code more readable when defining different versions of the API. #if !defined(Py\_LIMITED\_API) || Py\_LIMITED\_API+0 \>= 0x03070000 replace with #if !defined(Py\_LIMITED\_API) || Py…

---

_[View the full topic](https://discuss.python.org/t/adding-py-pack-version/58887)._
