pylint
pylint copied to clipboard
Add an option to check for misspellings in special functions
Is your feature request related to a problem? Please describe
Currently, the errors in naming of special functions aren't checked. Normal functions act as interfaces and they are readily checked. But for special functions, it becomes hard to confirm that the code written will work and many times, the eyes gloss over things like number of underscores (too many or too few, hard to distinguish), spelling (should that be invert or inv, eq or equal or equals).
class abc:
__init_(self):
pass
___neg__(self):
pass
__inv__(self):
pass
Describe the solution you'd like
Since the special functions are limited, testing for spellings (and offering the suggestions as a plugin) would be ideal.
This sounds useful, thanks for the suggestion!
Any tips on how to add this feature?
I guess it's possible to use that if a function name start and ends with __ then it's one of the official dunder methods for python.