Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd49a96

Browse files
committed
Follow current recommended practice in an example: Use isinstance() to
perform a type test instead of type(x) == types.FoobarType. In example for type().
1 parent 48022db commit fd49a96

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/lib/libfuncs.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ \section{Built-in Functions}
606606

607607
\bcode\begin{verbatim}
608608
>>> import types
609-
>>> if type(x) == types.StringType: print "It's a string"
609+
>>> if isinstance(x, types.StringType): print "It's a string"
610610
\end{verbatim}\ecode
611611
\end{funcdesc}
612612

Doc/libfuncs.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ \section{Built-in Functions}
606606

607607
\bcode\begin{verbatim}
608608
>>> import types
609-
>>> if type(x) == types.StringType: print "It's a string"
609+
>>> if isinstance(x, types.StringType): print "It's a string"
610610
\end{verbatim}\ecode
611611
\end{funcdesc}
612612

0 commit comments

Comments
 (0)