]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport comments about PyObject_Type() (HEAD revisions 1.24, 1.25).
authorFred Drake <fdrake@acm.org>
Wed, 9 Apr 2003 18:17:18 +0000 (18:17 +0000)
committerFred Drake <fdrake@acm.org>
Wed, 9 Apr 2003 18:17:18 +0000 (18:17 +0000)
Doc/api/abstract.tex

index 952b3d63a8a5333c802352a17a1759ecc5c85a62..ee26a27eae9adeb476c62ca2f65a720f44a6cc79 100644 (file)
@@ -296,9 +296,13 @@ determination.
 \begin{cfuncdesc}{PyObject*}{PyObject_Type}{PyObject *o}
   When \var{o} is non-\NULL, returns a type object corresponding to
   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})}.
-  \bifuncindex{type}
+  \exception{SystemError} and returns \NULL.\bifuncindex{type}
+  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 \ctype{PyTypeObject*}, except when the incremented reference
+  count is needed.
 \end{cfuncdesc}
 
 \begin{cfuncdesc}{int}{PyObject_TypeCheck}{PyObject *o, PyTypeObject *type}