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: |
@erictraut This is correct w.r.t. @rra 's original request in python/mypy/6131. @fellnerse and I seem to be discussing default values. |
|
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 |
|
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. |
Uh oh!
There was an error while loading. Please reload this page.
See here: python/mypy#6131
What do you think?
All reactions