Follow current recommended practice in an example: Use isinstance() to

perform a type test instead of type(x) == types.FoobarType.  In example
for type().
This commit is contained in:
Fred Drake 1998-01-11 21:15:23 +00:00
parent 48022db400
commit fd49a964bc
2 changed files with 2 additions and 2 deletions

View File

@ -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}

View File

@ -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}