Replies: 4 comments 20 replies
-
When you say "default types", am I correct in assuming that you want a way to represent that "the TypedDict is allowed to contain additional keys beyond what is specified, but they must be of this type"? There was a recent discussion about this in the typing sig related to this topic: |
Beta Was this translation helpful? Give feedback.
-
@erictraut This is correct w.r.t. @rra 's original request in python/mypy/6131. @fellnerse and I seem to be discussing default values. |
Beta Was this translation helpful? Give feedback.
-
One can make a dict with an additionalProperty type today in vscode per: https://stackoverflow.com/questions/73558897/in-python-how-can-i-make-a-dict-that-has-type-hints-for-know-keys-and-a-default/73559006?noredirect=1#comment129898346_73559006 |
Beta Was this translation helpful? Give feedback.
-
Currently it seems neither TypedDict+Unpack nor ParamSpec nor Protocol support (proper) forwarding of function parameter annotations. They almost do it but then fall short in differents ways. One then needs to resort to using explicit parameter classes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
See here: python/mypy#6131
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions