pythoncapi-compat icon indicating copy to clipboard operation
pythoncapi-compat copied to clipboard

The pythoncapi-compat project can be used to write a C extension supporting a wide range of Python versions with a single code base.

Results 5 pythoncapi-compat issues
Sort by recently updated
recently updated
newest added

Consider an example: ```c if (((PyObject*)obj)->data == Py_None) { 111; } if (Py_None == ((PyObject*)obj)->data) { 111; } ``` After ``upgrade_pythoncapi.py`` I got: ```c #include "pythoncapi_compat.h" if (((PyObject*)obj)->Py_IsNone(data)) { 111;...

By default, upgrade_pythoncapi.py enables all operations. Some operations are not strictly required to support Python 3.10 and Python 3.11 and can introduce many "unwanted" changes: * PyMem_MALLOC, PyObject_MALLOC, PyObject_NEW *...

If you include an old version of pythoncapi_compat.h header file and then include a new version of the header file, the new header is ignored by the **global** guard: ```...

PR created to check if it's possible to implement these functions in pythoncapi-compat for Python 3.13 and older.