summaryrefslogtreecommitdiffstats
path: root/Doc/extending
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-01-05 20:39:06 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-01-05 20:39:06 (GMT)
commit743ffe248c6b109ad7a3e0687da8ab2d22f985ce (patch)
tree2497be6e63bd56b8446df3df229ea12e3d783109 /Doc/extending
parent04c365d7fb8204d1178dab0e9030f86bb54894aa (diff)
parent63b55580fbe496204100e548ad41a10d933cc470 (diff)
downloadcpython-743ffe248c6b109ad7a3e0687da8ab2d22f985ce.zip
cpython-743ffe248c6b109ad7a3e0687da8ab2d22f985ce.tar.gz
cpython-743ffe248c6b109ad7a3e0687da8ab2d22f985ce.tar.bz2
merge 3.4
Diffstat (limited to 'Doc/extending')
-rw-r--r--Doc/extending/extending.rst15
1 files changed, 10 insertions, 5 deletions
diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst
index 12868d3..17cfdeb 100644
--- a/Doc/extending/extending.rst
+++ b/Doc/extending/extending.rst
@@ -20,12 +20,17 @@ source file by including the header ``"Python.h"``.
The compilation of an extension module depends on its intended use as well as on
your system setup; details are given in later chapters.
-Do note that if your use case is calling C library functions or system calls,
-you should consider using the :mod:`ctypes` module rather than writing custom
-C code. Not only does :mod:`ctypes` let you write Python code to interface
-with C code, but it is more portable between implementations of Python than
-writing and compiling an extension module which typically ties you to CPython.
+.. note::
+ The C extension interface is specific to CPython, and extension modules do
+ not work on other Python implementations. In many cases, it is possible to
+ avoid writing C extensions and preserve portability to other implementations.
+ For example, if your use case is calling C library functions or system calls,
+ you should consider using the :mod:`ctypes` module or the `cffi
+ <http://cffi.readthedocs.org>`_ library rather than writing custom C code.
+ These modules let you write Python code to interface with C code and are more
+ portable between implementations of Python than writing and compiling a C
+ extension module.
.. _extending-simpleexample: