-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
__dunder_blunder___ support #4592
Comments
This is an interesting one. I've also found mistakes like It's worth noting that Python's enum has some custom dunder methods and it may also be good to extend support for the custom sunder methods too? (I've mistakenly used |
Probably! Sunder method mistakes would be good to catch as well. |
I think we now support this via |
Hi, everyone!
I'm not sure if this rule would cover this or not: https://beta.ruff.rs/docs/rules/dunder-function-name/
I made a dunder blunder today, with an extra
_
. Despiteruff
,pyright
, andpytest
, nothing caught my error. It was for adef __lt__()
-type function.This seems fairly trivial, at first glance, at least compared to other rules. Those extra underscores can really blend in with eachother.
If the dunder-function-name does cover it, maybe it could be documented? Or maybe two separate rules would be ideal?
Anyway, Ruff is an awesome project. I don't know if there's an existing Python tool that does this check.
The text was updated successfully, but these errors were encountered: