-
Notifications
You must be signed in to change notification settings - Fork 107
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 B902 on custom metaclass extending ABCMeta #411
Comments
Is |
@cooperlees Line 990 in d1a8f2b
|
seems pretty straightforward to extend the check to also check for inheritance from |
It would seem that hardcoding all well-known meta classes list is going to be a never-ending story. Yet it's not my call to suggest how to tackle this issue |
that's unfortunately the way that AST-based static analysis checkers kind of have to do it. The "proper" way of doing it would be to hook into a type checker, but that's currently only possible if switching to LibCST and users run Pyre as their typechecker. |
Note that I added a list of well-known metaclasses in #415. It currently only contains the ones from the standard library, but that could of course be extended. |
@henzef I wonder if that could be extended to a configurable custom list from settings or something 🤔 |
It could definitely be done, adding something similar to |
causes B902 false-positive
The text was updated successfully, but these errors were encountered: