FelixTheC / strongtyping

Decorator which checks whether the function is called with the correct type of parameters.
https://pypi.org/project/strongtyping/
108 stars 3 forks source link

Initializing TypedDict like a normal class fails #71

Open FelixTheC opened 3 years ago

FelixTheC commented 3 years ago

Describe the bug When trying to create an instance of a TypedDict class in a way you would normaly create an instance. I got an error.

To Reproduce

@match_class_typing
class UserSelectedComponent(TypedDict):
    id: uuid.UUID
    min_concentration: float
    max_concentration: float

obj = UserSelectedComponent(
                id=uuid.UUID("f3567953-0f62-423b-9966-a8036b8fec25"),
                min_concentration=1.0,
                max_concentration=5.0,
            )

Expected behavior An instance of UserSelectedComponent should be created, if the data is valid.