This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JelleZijlstra
Recipients 97littleleaf11, AlexWaygood, JelleZijlstra, docs@python, sobolevn
Date 2022-02-07.19:27:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2022-02-07 19:27:59JelleZijlstrasetrecipients: + JelleZijlstra, docs@python, sobolevn, AlexWaygood, 97littleleaf11
2022-02-07 19:27:59JelleZijlstrasetmessageid: <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org>
2022-02-07 19:27:59JelleZijlstralinkissue46677 messages
2022-02-07 19:27:59JelleZijlstracreate