Mercurial > cpython-lru_cache-weakref
diff Doc/api/newtypes.tex @ 24603:73b309cf0213 legacy-trunk
Add some fine points: METH_KEYWORDS implies METH_VARARGS, and ob_size
is no longer unused in type objects.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 06 Aug 2002 17:18:56 +0000 |
| parents | dbabb1f7ed3a |
| children | e399d0a875b7 |
line wrap: on
line diff
--- a/Doc/api/newtypes.tex Tue Aug 06 17:14:04 2002 +0000 +++ b/Doc/api/newtypes.tex Tue Aug 06 17:18:56 2002 +0000 @@ -221,7 +221,9 @@ following flags. The individual flags indicate either a calling convention or a binding convention. Of the calling convention flags, only \constant{METH_VARARGS} and \constant{METH_KEYWORDS} can be -combined. Any of the calling convention flags can be combined with a +combined (but note that \constant{METH_KEYWORDS} alone is equivalent +to \code{\constant{METH_VARARGS} | \constant{METH_KEYWORDS}}). +Any of the calling convention flags can be combined with a binding flag. \begin{datadesc}{METH_VARARGS} @@ -335,11 +337,12 @@ \verbatiminput{typestruct.h} -The type object structure extends the \ctype{PyVarObject} structure, -though it does not actually need the the \member{ob_size} field. The -inclusion of this field is a historical accident that must be -maintained to ensure binary compatibility between new versions of -Python and older compiled extensions. +The type object structure extends the \ctype{PyVarObject} structure. +The \member{ob_size} field is used for dynamic types (created +by \function{type_new()}, usually called from a class statement). +Note that \cdata{PyType_Type} (the metatype) initializes +\member{tp_itemsize}, which means that its instances (i.e. type +objects) \emph{must} have the \member{ob_size} field. \begin{cmemberdesc}{PyObject}{PyObject*}{_ob_next} \cmemberline{PyObject}{PyObject*}{_ob_prev} @@ -1488,6 +1491,7 @@ \begin{ctypedesc}[getcharbufferproc]{int (*getcharbufferproc) (PyObject *self, int segment, const char **ptrptr)} +[Guido: the description is missing!] \end{ctypedesc}
