We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider the following code, running on Python 2.7.6:
>>> from builtins import * >>> l = [1,2,3] >>> type(l) is list False
Edit: this also happens if you use from builtins import str:
from builtins import str
>>> from builtins import str >>> s = 'foo' >>> type(str) is str False
I would suggest adding a warning regarding the type() function when using builtins and providing isinstance() as an alternative.
type()
isinstance()
The text was updated successfully, but these errors were encountered:
Since isinstance is the general guidance for all Python type-checking, I don't think a special warning is warranted here.
Sorry, something went wrong.
No branches or pull requests
Consider the following code, running on Python 2.7.6:
Edit: this also happens if you use
from builtins import str
:I would suggest adding a warning regarding the
type()
function when using builtins and providingisinstance()
as an alternative.The text was updated successfully, but these errors were encountered: