Skip to content

Commit abfa188

Browse files
committed
Update
1 parent d19037e commit abfa188

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Doc/c-api/intro.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,9 +865,15 @@ approaches to creating C and C++ extensions for Python:
865865
* `PyO3 <https://pyo3.rs/>`_ (Rust)
866866
* `SWIG <https://www.swig.org>`_
867867

868-
It is recommended to use these abstractions, rather than using directly the
869-
Python C API. These abstractions are built on top of the C API and handle API
870-
differences between the different Python versions.
868+
Using tools such as these can help avoid writing code that is tightly bound to
869+
a particular version of CPython, avoid reference counting errors, and focus
870+
more on your own code than on using the CPython API. In general, new versions
871+
of Python can be supported by updating the tool, and your code will often use
872+
newer and more efficient APIs automatically. Some tools also support compiling
873+
for other implementations of Python from a single set of sources.
874+
875+
Directly coding against the CPython C API should, in most cases, be your last
876+
resort rather than the first.
871877

872878
These projects are not supported by the same people who maintain Python, and
873879
issues need to be raised with the projects directly. Remember to check that the

Doc/tools/extensions/c_annotations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class CAPIToolsBanner(SphinxDirective):
275275

276276
text = sphinx_gettext(
277277
"It is recommended to use "
278-
":ref:`C API abstractions <c-api-tools>`, "
278+
":ref:`third party tools <c-api-tools>`, "
279279
"rather than using the Python C API directly."
280280
)
281281

0 commit comments

Comments
 (0)