Open nickdrozd opened 1 year ago
Parameterized generics can't be used for isinstance.
isinstance
isinstance(0, list[int])
TypeError: isinstance() argument 2 cannot be a parameterized generic
But Pylint doesn't warn about this.
No response
pylint
no warning
Raise isinstance-second-argument-not-valid-type
isinstance-second-argument-not-valid-type
pylint 2.17.0-dev0 astroid 2.15.0-dev0 Python 3.11.0
@nickdrozd Hi, could you provide some references about the fact generics cannot be used with isinstance?
generics
@nickdrozd thanks!:)
Bug description
Parameterized generics can't be used for
isinstance
.But Pylint doesn't warn about this.
Configuration
No response
Command used
Pylint output
Expected behavior
Raise
isinstance-second-argument-not-valid-type
Pylint version
OS / Environment
No response
Additional dependencies
No response