From fd49a964bcb473ef20acb70d278766012bf3b577 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Sun, 11 Jan 1998 21:15:23 +0000 Subject: [PATCH] Follow current recommended practice in an example: Use isinstance() to perform a type test instead of type(x) == types.FoobarType. In example for type(). --- Doc/lib/libfuncs.tex | 2 +- Doc/libfuncs.tex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index 51edb331e1..36582da0af 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 51edb331e1..36582da0af 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} -- 2.50.1