Skip to content

Weird, but legal ** syntax not accepted #5580

Closed
@warsaw

Description

@warsaw

I saw this in real code, although I don't really understand the reason why this is done. Still, even though it's a bit weird, it's legal and I think mypy should allow it:

class Foo:
    def __init__(self, a=1, b=2):
        self.a = a
        self.b = b


Foo(**{})
$ mypy foo.py
foo.py:7: error: Keywords must be strings

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions