Repository navigation
Commit cb1eadf
authored
Add support for the limited C API (Py_LIMITED_API) (#184)
Examples of API not available in the limited C API:
* PyBytesWriter
* PyConfig_Get(), PyConfig_GetInt().
* PyDict_ContainsString().
* PyFrame_GetBack(), PyFrame_GetVar()
* PyLongWriter_Create() and PyLong_Export()
* PyObject_VisitManagedDict(), PyObject_ClearManagedDict()
* PyThreadState_GetUnchecked()
* PyTime_t API.
* PyUnicodeWriter
* PyUnstable_SetImmortal().
* Py_SETREF(), Py_XSETREF().
Implementation notes:
* PyUnicode_EqualToUTF8AndSize() has no ASCII fast path.
* PyLong_GetSign(), PyLong_IsPositive(), PyLong_IsNegative() and
PyLong_IsZero() are implemented with PyObject_RichCompareBool().
* PyBytes_Join() calls PyObject_CallMethod(sep, "join", iterable).
* Add PYTHONCAPI_COMPAT_EXPECT_TYPE() macro to raise TypeError.
There are 3 implementations depending on the API and Python
version.
test_pythoncapi_compat.py now reuses the setup module to list tests.
Closes #1831 parent ba68139 commit cb1eadf
6 files changed
Lines changed: 791 additions & 308 deletions
0 commit comments