From: Guido van Rossum Date: Wed, 9 Apr 2003 18:02:23 +0000 (+0000) Subject: Try to discourage use of PyObject_Type(). X-Git-Tag: v2.3c1~1245 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6db771871ee3ad65109cd9791cc3ef339618f086;p=python Try to discourage use of PyObject_Type(). --- diff --git a/Doc/api/abstract.tex b/Doc/api/abstract.tex index 0822f620ee..a8bcc158de 100644 --- a/Doc/api/abstract.tex +++ b/Doc/api/abstract.tex @@ -319,6 +319,11 @@ determination. the object type of object \var{o}. On failure, raises \exception{SystemError} and returns \NULL. This is equivalent to the Python expression \code{type(\var{o})}. + This function increments the reference count of the return value. + There's really no reason to use this function instead of the + common expression \code{\var{o}->ob_type}, which returns a pointer + of type \code{PyTypeObject *}, except when the incremented reference + count is needed. \bifuncindex{type} \end{cfuncdesc}