Skip to content

UserDict: " Unexpected keyword argument..." error #2075

@pawelswiecki

Description

@pawelswiecki

mypy==0.590

from collections import UserDict

class MyDict(UserDict):
    pass

m = MyDict(bob=1, frank=2)

print(m)  # {'bob': 1, 'frank': 2}

now:

$ mypy user_dict.py 
user_dict.py:8: error: Unexpected keyword argument "bob" for "MyDict"
user_dict.py:8: error: Unexpected keyword argument "frank" for "MyDict"

I think this is not a derisable behaviour.

Correct me if it's not a typeshed issue, but a mypy one. Also, I did check (here and in google) I did not find anything on this particular thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions