-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation
Milestone
Description
Bug description
I think that pylint should detect the case when type()
is used to compare two types, in which case IMHO isisntance()
should not be used:
if type(a) == type(b):
...
Configuration
Command used
pylint
Pylint output
C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
Expected behavior
No error triggered.
Pylint version
pylint 3.0.3
astroid 3.0.2
Python 3.12.3 (main, Nov 6 2024, 18:32:19) [GCC 13.2.0]
OS / Environment
No response
Additional dependencies
Metadata
Metadata
Assignees
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation