]> granicus.if.org Git - python/commitdiff
Document new behavior of isinstance() when using a type object.
authorGuido van Rossum <guido@python.org>
Tue, 2 Dec 1997 19:15:01 +0000 (19:15 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 2 Dec 1997 19:15:01 +0000 (19:15 +0000)
Doc/lib/libfuncs.tex
Doc/libfuncs.tex

index 0211cecad82707ac500cde490ad5fc2a109bc25a..0182dcba38c7040673211c5596a5a256c8e15200 100644 (file)
@@ -308,9 +308,11 @@ module from which it is called).
 \begin{funcdesc}{isinstance}{object, class}
 Return true if the \var{object} argument is an instance of the
 \var{class} argument, or of a (direct or indirect) subclass thereof.
-If \var{object} is not a class instance, the function always returns
-false.  If \var{class} is not a class object, a \code{TypeError}
-exception is raised.
+Also return true if \var{class} is a type object and \var{object} is
+an object of that type.  If \var{object} is not a class instance or a
+object of the given type, the function always returns false.  If
+\var{class} is neither a class object nor a type object, a
+\code{TypeError} exception is raised.
 \end{funcdesc}
 
 \begin{funcdesc}{issubclass}{class1, class2}
index 0211cecad82707ac500cde490ad5fc2a109bc25a..0182dcba38c7040673211c5596a5a256c8e15200 100644 (file)
@@ -308,9 +308,11 @@ module from which it is called).
 \begin{funcdesc}{isinstance}{object, class}
 Return true if the \var{object} argument is an instance of the
 \var{class} argument, or of a (direct or indirect) subclass thereof.
-If \var{object} is not a class instance, the function always returns
-false.  If \var{class} is not a class object, a \code{TypeError}
-exception is raised.
+Also return true if \var{class} is a type object and \var{object} is
+an object of that type.  If \var{object} is not a class instance or a
+object of the given type, the function always returns false.  If
+\var{class} is neither a class object nor a type object, a
+\code{TypeError} exception is raised.
 \end{funcdesc}
 
 \begin{funcdesc}{issubclass}{class1, class2}