mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
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:
parent
48022db400
commit
fd49a964bc
2 changed files with 2 additions and 2 deletions
|
|
@ -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}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue