diff options
author | Walter Dörwald <walter@livinglogic.de> | 2002-12-06 10:09:16 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2002-12-06 10:09:16 (GMT) |
commit | 6d5f30eaedd8969a08c3d3ef9b604b9b95401300 (patch) | |
tree | 265a4f229957be883152aa68c7e9a672172292cf /Doc/api | |
parent | 5f61a05d7f3a53e627fe14c74b1ba5ecc34eb1de (diff) | |
download | cpython-6d5f30eaedd8969a08c3d3ef9b604b9b95401300.zip cpython-6d5f30eaedd8969a08c3d3ef9b604b9b95401300.tar.gz cpython-6d5f30eaedd8969a08c3d3ef9b604b9b95401300.tar.bz2 |
Document that the second argument to PyObject_IsInstance
may be a tuple. This closes SF patch
http://www.python.org/sf/649095
Backport to release22-maint will follow.
Diffstat (limited to 'Doc/api')
-rw-r--r-- | Doc/api/abstract.tex | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/api/abstract.tex b/Doc/api/abstract.tex index c5939b2..1cf69dc 100644 --- a/Doc/api/abstract.tex +++ b/Doc/api/abstract.tex @@ -175,12 +175,16 @@ for which they do not apply, they will raise a Python exception. or a subclass of \var{cls}, or \code{0} if not. On error, returns \code{-1} and sets an exception. If \var{cls} is a type object rather than a class object, \cfunction{PyObject_IsInstance()} - returns \code{1} if \var{inst} is of type \var{cls}. If \var{inst} - is not a class instance and \var{cls} is neither a type object or - class object, \var{inst} must have a \member{__class__} attribute + returns \code{1} if \var{inst} is of type \var{cls}. If \var{cls} + is a tuple, the check will be done against every entry in \var{cls}. + The result will be \code{1} when at least one of the checks returns + \code{1}, otherwise it will be \code{0}. If \var{inst} is not a class + instance and \var{cls} is neither a type object, nor a class object, + nor a tuple, \var{inst} must have a \member{__class__} attribute --- the class relationship of the value of that attribute with \var{cls} will be used to determine the result of this function. \versionadded{2.1} + \versionchanged[Support for a tuple as the second argument added]{2.2} \end{cfuncdesc} Subclass determination is done in a fairly straightforward way, but |