@@ -611,7 +611,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
611611 Note that the :c:member: `~PyVarObject.ob_size ` field may later be used for
612612 other purposes. For example, :py:type: `int ` instances use the bits of
613613 :c:member: `~PyVarObject.ob_size ` in an implementation-defined
614- way; the underlying storage and its size should be acessed using
614+ way; the underlying storage and its size should be accessed using
615615 :c:func: `PyLong_Export `.
616616
617617 .. note ::
@@ -703,10 +703,13 @@ and :c:data:`PyType_Type` effectively act as defaults.)
703703
704704 .. code-block :: c
705705
706- static void foo_dealloc(foo_object *self) {
706+ static void
707+ foo_dealloc(PyObject *op)
708+ {
709+ foo_object *self = (foo_object *) op;
707710 PyObject_GC_UnTrack(self);
708711 Py_CLEAR(self->ref);
709- Py_TYPE(self)->tp_free((PyObject *) self);
712+ Py_TYPE(self)->tp_free(self);
710713 }
711714
712715 Finally, if the type is heap allocated (:c:macro: `Py_TPFLAGS_HEAPTYPE `), the
@@ -717,10 +720,12 @@ and :c:data:`PyType_Type` effectively act as defaults.)
717720
718721 .. code-block :: c
719722
720- static void foo_dealloc(foo_object *self) {
721- PyTypeObject *tp = Py_TYPE(self);
723+ static void
724+ foo_dealloc(PyObject *op)
725+ {
726+ PyTypeObject *tp = Py_TYPE(op);
722727 // free references and buffers here
723- tp->tp_free(self );
728+ tp->tp_free(op );
724729 Py_DECREF(tp);
725730 }
726731
@@ -1416,8 +1421,9 @@ and :c:data:`PyType_Type` effectively act as defaults.)
14161421 :mod: `!_thread ` extension module::
14171422
14181423 static int
1419- local_traverse(localobject *self , visitproc visit, void *arg)
1424+ local_traverse(PyObject *op , visitproc visit, void *arg)
14201425 {
1426+ localobject *self = (localobject *) op;
14211427 Py_VISIT(self->args);
14221428 Py_VISIT(self->kw);
14231429 Py_VISIT(self->dict);
@@ -1511,8 +1517,9 @@ and :c:data:`PyType_Type` effectively act as defaults.)
15111517 members to ``NULL ``, as in the following example::
15121518
15131519 static int
1514- local_clear(localobject *self )
1520+ local_clear(PyObject *op )
15151521 {
1522+ localobject *self = (localobject *) op;
15161523 Py_CLEAR(self->key);
15171524 Py_CLEAR(self->args);
15181525 Py_CLEAR(self->kw);
0 commit comments