Skip to content

Additional keyword args in class declaration not supported #573

Closed

Description

@gvanrossum

In Python 3 you can have arbitrary keyword args in a class declaration, as follows:

class C(metaclass=MyMeta, extra=42):
    ...

Here, mypy reports a syntax error at the comma.

Activity

  1. JukkaL commented on Feb 6, 2015

    @JukkaL
    Collaborator

    Ah, I didn't know about that!

  2. JukkaL commented on Feb 8, 2015

    @JukkaL
    Collaborator

    Bumping priority since I want to work towards full Python 3 syntax support.

  3. JelleZijlstra commented on Jul 1, 2017

    @JelleZijlstra
    Member

    This is fixed; there are tests in test-data/unit/parse.test that do class Foo(metaclass=Bar, _root=None): pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions