-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
False positive A003
when overriding threading.Event.set
#5956
Comments
Probably not... but somewhat low-priority for me, since we can't resolve the superclasses anyway and it's not a hugely popular rule. The most lightweight thing I could see us doing for now is ignoring methods annotated with |
Just out of curiosity, why can't |
Ruff doesn't resolve symbols across files right now, though it will in the future (I've been working on it a bit but there's no defined timeline for it).
|
I will special-case some stuff in the standard library for now. |
…6074) ## Summary If a user subclasses `threading.Event`, e.g. with: ```python from threading import Event class CustomEvent(Event): def set(self) -> None: ... ``` They no control over the method name (`set`). This PR allows `threading.Event#set` and `logging.Filter#filter` overrides, and avoids flagging A003 in such cases. Ideally, we'd avoid flagging all overridden methods, but... that's a lot more difficult, and this is at least _better_ than what we do now. Closes #6057. Closes #5956.
Running
ruff==0.0.279
:This seems like a false positive, as one has to use the word
set
to override theEvent
parent class's method.Should
A003
be raised on method overrides?The text was updated successfully, but these errors were encountered: