Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to check for misspellings in special functions #3038

Closed
kunaltyagi opened this issue Aug 2, 2019 · 3 comments · Fixed by #7642
Closed

Add an option to check for misspellings in special functions #3038

kunaltyagi opened this issue Aug 2, 2019 · 3 comments · Fixed by #7642
Labels
Checkers Related to a checker Enhancement ✨ Improvement to a component Good first issue Friendly and approachable by new contributors Hacktoberfest Help wanted 🙏 Outside help would be appreciated, good for new contributors Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@kunaltyagi
Copy link

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.

@PCManticore
Copy link
Contributor

This sounds useful, thanks for the suggestion!

@PCManticore PCManticore added Checkers Related to a checker Good first issue Friendly and approachable by new contributors Enhancement ✨ Improvement to a component labels Aug 6, 2019
@kunaltyagi
Copy link
Author

Any tips on how to add this feature?

@Pierre-Sassoulas Pierre-Sassoulas added the Help wanted 🙏 Outside help would be appreciated, good for new contributors label Mar 2, 2021
@Pierre-Sassoulas
Copy link
Member

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.

@Pierre-Sassoulas Pierre-Sassoulas added the Needs PR This issue is accepted, sufficiently specified and now needs an implementation label Jul 4, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.16.0 milestone Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Checkers Related to a checker Enhancement ✨ Improvement to a component Good first issue Friendly and approachable by new contributors Hacktoberfest Help wanted 🙏 Outside help would be appreciated, good for new contributors Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants