diff options
author | Jim Fulton <jim@zope.com> | 2003-05-16 13:51:58 (GMT) |
---|---|---|
committer | Jim Fulton <jim@zope.com> | 2003-05-16 13:51:58 (GMT) |
commit | a24d73ddb15c8f1d1a2073a4cc16859333d23bb4 (patch) | |
tree | 447ad4fffd2a78d13c7905dada900a57cd3c028c /Doc/ext | |
parent | 19472b2075aab1f001faf89f56e4b053f65e45f9 (diff) | |
download | cpython-a24d73ddb15c8f1d1a2073a4cc16859333d23bb4.zip cpython-a24d73ddb15c8f1d1a2073a4cc16859333d23bb4.tar.gz cpython-a24d73ddb15c8f1d1a2073a4cc16859333d23bb4.tar.bz2 |
Added a missing PyObject* cast to the dealloc examples.
Added a note that the mechanism for defining new tyoes documented here
only works for Python 2.2 and higher.
Diffstat (limited to 'Doc/ext')
-rw-r--r-- | Doc/ext/newtypes.tex | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Doc/ext/newtypes.tex b/Doc/ext/newtypes.tex index 3d611c1..ca73985 100644 --- a/Doc/ext/newtypes.tex +++ b/Doc/ext/newtypes.tex @@ -12,6 +12,14 @@ This is not hard; the code for all extension types follows a pattern, but there are some details that you need to understand before you can get started. +\begin{notice} +The way new types are defined changed dramatically (and for the +better) in Python 2.2. This document documents how to define new +types for Python 2.2 and later. If you need to support older +versions of Python, you will need to refer to older versions of this +documentation. +\end{notice} + \section{The Basics \label{dnt-basics}} @@ -306,7 +314,7 @@ Noddy_dealloc(Noddy* self) { Py_XDECREF(self->first); Py_XDECREF(self->last); - self->ob_type->tp_free(self); + self->ob_type->tp_free((PyObject*)self); } \end{verbatim} @@ -792,7 +800,7 @@ my_dealloc(PyObject *obj) Py_DECREF(self->my_callback); } - obj->ob_type->tp_free(self); + obj->ob_type->tp_free((PyObject*)self); } \end{verbatim} |