[Python-checkins] r67632 - python/branches/py3k/Doc/extending/newtypes.rst

georg.brandl python-checkins at python.org
Sun Dec 7 15:09:21 CET 2008


Author: georg.brandl
Date: Sun Dec 7 15:09:20 2008
New Revision: 67632
Log:
#4576: fix ob_type access.
Modified:
 python/branches/py3k/Doc/extending/newtypes.rst
Modified: python/branches/py3k/Doc/extending/newtypes.rst
==============================================================================
--- python/branches/py3k/Doc/extending/newtypes.rst	(original)
+++ python/branches/py3k/Doc/extending/newtypes.rst	Sun Dec 7 15:09:20 2008
@@ -265,7 +265,7 @@
 {
 Py_XDECREF(self->first);
 Py_XDECREF(self->last);
- self->ob_type->tp_free((PyObject*)self);
+ Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 which is assigned to the :attr:`tp_dealloc` member::
@@ -759,7 +759,7 @@
 Noddy_dealloc(Noddy* self)
 {
 Noddy_clear(self);
- self->ob_type->tp_free((PyObject*)self);
+ Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 Notice the use of a temporary variable in :cfunc:`Noddy_clear`. We use the
@@ -952,7 +952,7 @@
 newdatatype_dealloc(newdatatypeobject * obj)
 {
 free(obj->obj_UnderlyingDatatypePtr);
- obj->ob_type->tp_free(obj);
+ Py_TYPE(obj)->tp_free(obj);
 }
 
 .. index::
@@ -995,7 +995,7 @@
 
 Py_DECREF(self->my_callback);
 }
- obj->ob_type->tp_free((PyObject*)self);
+ Py_TYPE(obj)->tp_free((PyObject*)self);
 }
 
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /