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

Make mypy happy when initializing TypeDicts from coregistration methods #571

Closed
rhugonnet opened this issue Aug 27, 2024 · 0 comments · Fixed by #530
Closed

Make mypy happy when initializing TypeDicts from coregistration methods #571

rhugonnet opened this issue Aug 27, 2024 · 0 comments · Fixed by #530
Labels
test-suite Issue related to testing

Comments

@rhugonnet
Copy link
Member

rhugonnet commented Aug 27, 2024

See for instance here:

super().__init__(meta=meta_bin) # type: ignore

A lot of other instances added in #530.

The TypedDict are super useful to declare the expected type of keys and values, but initializing them without this error is a hassle. Maybe I'm simply doing something wrong...

I found some related posts, but nothing that helped me solving this issue:
https://stackoverflow.com/questions/73242556/typeddict-class-is-an-incompatible-type-for-function-expecting-dict
python/mypy#13122

An important note:
Most users rely on the fact that TypedDict always have a fixed number of keys, but here we don't (argument total=False of TypedDict).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-suite Issue related to testing
Projects
None yet
1 participant