Try to discourage use of PyObject_Type().

This commit is contained in:
Guido van Rossum 2003-04-09 18:02:23 +00:00
parent fc29646a2e
commit 6db771871e
1 changed files with 5 additions and 0 deletions

View File

@ -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}