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

Check keyword arguments in class definitions #2653

Open
JelleZijlstra opened this issue Jan 7, 2017 · 1 comment
Open

Check keyword arguments in class definitions #2653

JelleZijlstra opened this issue Jan 7, 2017 · 1 comment
Labels

Comments

@JelleZijlstra
Copy link
Member

Currently, this incorrect code passes mypy:

class C(a=3):
    pass

It should check that __new__/__init_subclass__ accepts these keyword arguments.

This doesn't seem high-priority to fix since custom class kwargs are rarely used and this should usually cause import-time errors anyway when running the code, but I'm reporting it so it can be tracked.

@ilevkivskyi
Copy link
Member

Support for checking against __init_subclass__() was added in 0.730. Checking against __new__() of metaclass is still to do (btw it makes me think this can cause some false positives).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants