[Python-checkins] python/dist/src/Doc/lib libfuncs.tex,1.122,1.123

doerwalter@users.sourceforge.net doerwalter@users.sourceforge.net
Thu, 12 Dec 2002 08:42:11 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv439/Doc/lib

Modified Files:
	libfuncs.tex 
Log Message:
Enhance issubclass() and PyObject_IsSubclass() so that a tuple is
supported as the second argument. This has the same meaning as
for isinstance(), i.e. issubclass(X, (A, B)) is equivalent
to issubclass(X, A) or issubclass(X, B). Compared to isinstance(),
this patch does not search the tuple recursively for classes, i.e.
any entry in the tuple that is not a class, will result in a
TypeError.

This closes SF patch #649608.


Index: libfuncs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v
retrieving revision 1.122
retrieving revision 1.123
diff -C2 -d -r1.122 -r1.123
*** libfuncs.tex	23 Nov 2002 15:02:13 -0000	1.122
--- libfuncs.tex	12 Dec 2002 16:41:38 -0000	1.123
***************
*** 551,559 ****
  \end{funcdesc}
  
! \begin{funcdesc}{issubclass}{class1, class2}
!   Return true if \var{class1} is a subclass (direct or indirect) of
!   \var{class2}.  A class is considered a subclass of itself.  If
!   either argument is not a class object, a \exception{TypeError}
!   exception is raised.
  \end{funcdesc}
  
--- 551,561 ----
  \end{funcdesc}
  
! \begin{funcdesc}{issubclass}{class, classinfo}
!   Return true if \var{class} is a subclass (direct or indirect) of
!   \var{classinfo}.  A class is considered a subclass of itself.
!   \var{classinfo} may be a tuple of class objects, in which case every
!   entry in \var{classinfo} will be checked. In any other case, a
!   \exception{TypeError} exception is raised.
!   \versionchanged[Support for a tuple of type information was added]{2.3}
  \end{funcdesc}