unidiomatic-typecheck has descriptive rather than prescriptive lint message text #3891
Labels
Enhancement ✨
Improvement to a component
Good first issue
Friendly and approachable by new contributors
Help wanted 🙏
Outside help would be appreciated, good for new contributors
https://github.com/PyCQA/pylint/blob/master/pylint/checkers/base.py#L2314 unidiomatic-typecheck
The error message is currently along the lines of:
Using type() instead of isinstance() for a typecheck. [unidiomatic-typecheck]
which is easy for users to misread as "use type instead of isinstance" which is the opposite of what we want and is what their code already does, leaving them wondering what they're not seeing. The sentence isn't obviously stating that what it describes is a problem and doesn't directly suggest the solution.
I suggest rewording this lint message short description to be prescriptive
Use isinstance() rather than type() comparisons for a typecheck.
(this wording exists up through at least pylint 2.6.0)
The text was updated successfully, but these errors were encountered: