From: Fred Drake Date: Sun, 11 Jan 1998 21:15:23 +0000 (+0000) Subject: Follow current recommended practice in an example: Use isinstance() to X-Git-Tag: v1.5.1~996 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd49a964bcb473ef20acb70d278766012bf3b577;p=thirdparty%2FPython%2Fcpython.git Follow current recommended practice in an example: Use isinstance() to perform a type test instead of type(x) == types.FoobarType. In example for type(). --- diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index 51edb331e167..36582da0af6e 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -606,7 +606,7 @@ For instance: \bcode\begin{verbatim} >>> import types ->>> if type(x) == types.StringType: print "It's a string" +>>> if isinstance(x, types.StringType): print "It's a string" \end{verbatim}\ecode \end{funcdesc} diff --git a/Doc/libfuncs.tex b/Doc/libfuncs.tex index 51edb331e167..36582da0af6e 100644 --- a/Doc/libfuncs.tex +++ b/Doc/libfuncs.tex @@ -606,7 +606,7 @@ For instance: \bcode\begin{verbatim} >>> import types ->>> if type(x) == types.StringType: print "It's a string" +>>> if isinstance(x, types.StringType): print "It's a string" \end{verbatim}\ecode \end{funcdesc}