summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-01-11 21:15:23 (GMT)
committerFred Drake <fdrake@acm.org>1998-01-11 21:15:23 (GMT)
commitfd49a964bcb473ef20acb70d278766012bf3b577 (patch)
tree6f31e5b61f79df3bef1a82ba03ae23dd22b95aa3
parent48022db400aff1172bd07533774224a61b2bfd7d (diff)
downloadcpython-fd49a964bcb473ef20acb70d278766012bf3b577.zip
cpython-fd49a964bcb473ef20acb70d278766012bf3b577.tar.gz
cpython-fd49a964bcb473ef20acb70d278766012bf3b577.tar.bz2
Follow current recommended practice in an example: Use isinstance() to
perform a type test instead of type(x) == types.FoobarType. In example for type().
-rw-r--r--Doc/lib/libfuncs.tex2
-rw-r--r--Doc/libfuncs.tex2
2 files changed, 2 insertions, 2 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex
index 51edb33..36582da 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 51edb33..36582da 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}