diff options
Diffstat (limited to 'Doc/extending')
-rw-r--r-- | Doc/extending/extending.rst | 2 | ||||
-rw-r--r-- | Doc/extending/newtypes.rst | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index c4ced1a..7f1ad5d 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -321,7 +321,7 @@ parameters to be passed in as a tuple acceptable for parsing via The :const:`METH_KEYWORDS` bit may be set in the third field if keyword arguments should be passed to the function. In this case, the C function should -accept a third ``PyObject \*`` parameter which will be a dictionary of keywords. +accept a third ``PyObject *`` parameter which will be a dictionary of keywords. Use :c:func:`PyArg_ParseTupleAndKeywords` to parse the arguments to such a function. diff --git a/Doc/extending/newtypes.rst b/Doc/extending/newtypes.rst index 2ba01bc..6a65941 100644 --- a/Doc/extending/newtypes.rst +++ b/Doc/extending/newtypes.rst @@ -288,18 +288,16 @@ strings, so we provide a new method:: self = (Noddy *)type->tp_alloc(type, 0); if (self != NULL) { self->first = PyString_FromString(""); - if (self->first == NULL) - { + if (self->first == NULL) { Py_DECREF(self); return NULL; - } + } self->last = PyString_FromString(""); - if (self->last == NULL) - { + if (self->last == NULL) { Py_DECREF(self); return NULL; - } + } self->number = 0; } |