File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,12 +20,17 @@ source file by including the header ``"Python.h"``.
2020The compilation of an extension module depends on its intended use as well as on
2121your system setup; details are given in later chapters.
2222
23- Do note that if your use case is calling C library functions or system calls,
24- you should consider using the :mod: `ctypes ` module rather than writing custom
25- C code. Not only does :mod: `ctypes ` let you write Python code to interface
26- with C code, but it is more portable between implementations of Python than
27- writing and compiling an extension module which typically ties you to CPython.
23+ .. note ::
2824
25+ The C extension interface is specific to CPython, and extension modules do
26+ not work on other Python implementations. In many cases, it is possible to
27+ avoid writing C extensions and preserve portability to other implementations.
28+ For example, if your use case is calling C library functions or system calls,
29+ you should consider using the :mod: `ctypes ` module or the `cffi
30+ <http://cffi.readthedocs.org> `_ library rather than writing custom C code.
31+ These modules let you write Python code to interface with C code and are more
32+ portable between implementations of Python than writing and compiling a C
33+ extension module.
2934
3035
3136.. _extending-simpleexample :
You can’t perform that action at this time.
0 commit comments