Message412784
https://docs.python.org/3.10/library/typing.html#typing.TypedDict
It says:
> To allow using this feature with older versions of Python that do not support PEP 526, TypedDict supports two additional equivalent syntactic forms
But there is another reason to use the equivalent forms: if your keys aren't valid Python names. There's an example in typeshed that uses "in" (a keyword) as a TypedDict key, and I've seen others with keys that have hyphens in them.
Also:
- The docs mention attributes like `__required_keys__`, but don't clearly say what is in these attributes. We should document them explicitly with the standard syntax for attributes.
- There is no mention of one TypedDict inheriting from another. |
|
Date |
User |
Action |
Args |
2022-02-07 19:27:59 | JelleZijlstra | set | recipients:
+ JelleZijlstra, docs@python, sobolevn, AlexWaygood, 97littleleaf11 |
2022-02-07 19:27:59 | JelleZijlstra | set | messageid: <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org> |
2022-02-07 19:27:59 | JelleZijlstra | link | issue46677 messages |
2022-02-07 19:27:59 | JelleZijlstra | create | |
|