diff options
| author | Stefan Krah <skrah@bytereef.org> | 2013-01-20 22:29:28 (GMT) |
|---|---|---|
| committer | Stefan Krah <skrah@bytereef.org> | 2013-01-20 22:29:28 (GMT) |
| commit | b357db885c8c20bf085d6b65892a618a51b4e1b0 (patch) | |
| tree | c421506e1918c2a9c1f3d579736242427c7d907f | |
| parent | 926f3a37de4def3e891f1533bd2edcf292aa74d2 (diff) | |
| download | cpython-b357db885c8c20bf085d6b65892a618a51b4e1b0.zip cpython-b357db885c8c20bf085d6b65892a618a51b4e1b0.tar.gz cpython-b357db885c8c20bf085d6b65892a618a51b4e1b0.tar.bz2 | |
Backport 6df456f8fc6d.
| -rw-r--r-- | Doc/howto/cporting.rst | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/Doc/howto/cporting.rst b/Doc/howto/cporting.rst index 9d8a1b0..1ad77d6 100644 --- a/Doc/howto/cporting.rst +++ b/Doc/howto/cporting.rst @@ -100,25 +100,6 @@ corresponds to Python 2's :func:`long` type--the :func:`int` type used in Python 2 was removed. In the C-API, ``PyInt_*`` functions are replaced by their ``PyLong_*`` equivalents. -The best course of action here is using the ``PyInt_*`` functions aliased to -``PyLong_*`` found in :file:`intobject.h`. The abstract ``PyNumber_*`` APIs -can also be used in some cases. :: - - #include "Python.h" - #include "intobject.h" - - static PyObject * - add_ints(PyObject *self, PyObject *args) { - int one, two; - PyObject *result; - - if (!PyArg_ParseTuple(args, "ii:add_ints", &one, &two)) - return NULL; - - return PyInt_FromLong(one + two); - } - - Module initialization and state =============================== |
