mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.12] Fix inaccuracies in "Assorted Topics" section of "Defining Extension Types" tutorial (GH-104969) (#105850)
Fix inaccuracies in "Assorted Topics" section of "Defining Extension Types" tutorial (GH-104969)
(cherry picked from commit 0d0963737a
)
Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
This commit is contained in:
parent
f94cb788f9
commit
6f0f27eba0
1 changed files with 5 additions and 5 deletions
|
@ -338,7 +338,7 @@ Here is an example::
|
||||||
|
|
||||||
PyErr_Format(PyExc_AttributeError,
|
PyErr_Format(PyExc_AttributeError,
|
||||||
"'%.100s' object has no attribute '%.400s'",
|
"'%.100s' object has no attribute '%.400s'",
|
||||||
tp->tp_name, name);
|
Py_TYPE(obj)->tp_name, name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,7 +379,7 @@ Here is a sample implementation, for a datatype that is considered equal if the
|
||||||
size of an internal pointer is equal::
|
size of an internal pointer is equal::
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
newdatatype_richcmp(PyObject *obj1, PyObject *obj2, int op)
|
newdatatype_richcmp(newdatatypeobject *obj1, newdatatypeobject *obj2, int op)
|
||||||
{
|
{
|
||||||
PyObject *result;
|
PyObject *result;
|
||||||
int c, size1, size2;
|
int c, size1, size2;
|
||||||
|
@ -478,7 +478,7 @@ This function takes three arguments:
|
||||||
Here is a toy ``tp_call`` implementation::
|
Here is a toy ``tp_call`` implementation::
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
newdatatype_call(newdatatypeobject *self, PyObject *args, PyObject *kwds)
|
newdatatype_call(newdatatypeobject *obj, PyObject *args, PyObject *kwds)
|
||||||
{
|
{
|
||||||
PyObject *result;
|
PyObject *result;
|
||||||
const char *arg1;
|
const char *arg1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue