Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33
The pythoncapi-compat project can be used to write a C extension supporting a wide range of Python versions with a single code base.
License
python/pythoncapi-compat
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Thepythoncapi-compat project can be used to write a C or C++ extensionsupporting a wide range of Python versions with a single code base. It is madeof thepythoncapi_compat.h header file and theupgrade_pythoncapi.pyscript.
upgrade_pythoncapi.py requires Python 3.6 or newer.
See thedocumentation at ReadTheDocsfor more details.
To upgrade a specific file:
python3 upgrade_pythoncapi.py module.c
To upgrade all C/C++ files in a directory:
python3 upgrade_pythoncapi.py src/
To only replaceop->ob_type withPy_TYPE(op), select thePy_TYPEoperation with:
python3 upgrade_pythoncapi.py -o Py_TYPE module.c
Or the opposite, to apply all operations but leaveop->ob_type unchanged,deselect thePy_TYPE operation with:
python3 upgrade_pythoncapi.py -o all,-Py_TYPE module.c
If you want topythoncapi_compat.h to your code base, use theupgrade_pythoncapi.py tool to fetch it:
python3 upgrade_pythoncapi.py --download PATH
This project is distributed under theZero Clause BSD (0BSD) license and is covered by thePSF Code ofConduct.
About
The pythoncapi-compat project can be used to write a C extension supporting a wide range of Python versions with a single code base.
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.