From: Stefan Krah Date: Sun, 20 Jan 2013 22:18:00 +0000 (+0100) Subject: Issue #7353: Remove references to Include/intobject.h in the C-porting howto. X-Git-Tag: v3.3.1rc1~323 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4aa08e52b1bcf043ec5c9bcfd55268cb4161e3d;p=python Issue #7353: Remove references to Include/intobject.h in the C-porting howto. --- diff --git a/Doc/howto/cporting.rst b/Doc/howto/cporting.rst index 9d8a1b0e35..1ad77d687e 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 ===============================