Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions content/week09_binding/02-cpython/02-cpython.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,19 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## [Python limited API: PEP 384](https://www.python.org/dev/peps/pep-0384)\n",
"## [Python limited API: PEP 384](https://peps.python.org/pep-0384/)\n",
"\n",
"One possible benefit of building your own Python extensions this way is that you can use the *Python limited API*. This defines a reduced subset of functionality that you must stick to, but in return, you now can use a single compiled extension with *multiple* versions of Python, from a minimum (3.2 or later) to the current version (and future versions!).\n",
"One possible benefit of building your own Python extensions this way is that you can use the *Python limited API*. This defines a reduced subset of functionality that you must stick to, but in return, you now can use a single compiled extension with *multiple* versions of Python, from a minimum (3.2 or later) to the current version (and future versions!). [PEP 803](https://peps.python.org/pep-0803/) adds abi3t, a stable ABI that works with both free-threaded and regular builds of Python 3.15+.\n",
"\n",
"[PyBuffer](https://jakevdp.github.io/blog/2014/05/05/introduction-to-the-python-buffer-protocol/) protocol support was not part of the limited API until Python 3.11.\n",
"\n",
"Nanobind (a light weight set of the core pybind11 functionality for C++17+ and Python 3.9+) supports the limited API for Python 3.12+."
"Support:\n",
"\n",
"* nanobind (a lightweight set of the core pybind11 functionality for C++17+ and Python 3.9+) supports the limited API for Python 3.12+.\n",
"* pybind11 support is in progress ([pybind11#6198](https://github.com/pybind/pybind11/pull/6198)).\n",
"* Rust via PyO3 supports it with the `abi3-py3X` features, and maturin tags the wheels.\n",
"* Cython 3.1+ supports it. abi3t is not supported yet.\n",
"* SWIG 4.2+ supports it, but not with `-builtin`."
]
},
{
Expand Down
Loading