You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not really sure if it's a real issue... But, the bug (my own) bit me, and I thought pylint would have saved me from it...
Here's the example code:
#! /usr/bin/env python3
# vim: expandtab shiftwidth=4 tabstop=4
"""This program demonstrates that pylint doesn't catch
instanceof "types" """
def main():
print(isinstance("x", hash))
if __name__ == "__main__":
main()
If I run it tho, I get:
$ python3 ./demo.py
Traceback (most recent call last):
File "./demo.py", line 11, in <module>
main()
File "./demo.py", line 8, in main
print(isinstance("x", hash))
TypeError: isinstance() arg 2 must be a type or tuple of types
it's pylint clean tho:
$ python3 -m pylint --version
pylint 2.4.3
astroid 2.3.2
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0]
$ python3 -m pylint -r n demo.py
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
Is that a problem? (In this case, I said "hash" where I meant "dict")
Thanks!
The text was updated successfully, but these errors were encountered:
… type (#3404)
The second argument to isinstance must be either a type or a tuple of types.
Close#3308
Co-authored-by: Claudiu Popa <pcmanticore@gmail.com>
Not really sure if it's a real issue... But, the bug (my own) bit me, and I thought pylint would have saved me from it...
Here's the example code:
If I run it tho, I get:
it's pylint clean tho:
Is that a problem? (In this case, I said "hash" where I meant "dict")
Thanks!
The text was updated successfully, but these errors were encountered: