[New-bugs-announce] [issue46677] TypedDict docs are incomplete
Jelle Zijlstra
report at bugs.python.org
Mon Feb 7 14:27:59 EST 2022
New submission from Jelle Zijlstra <jelle.zijlstra at gmail.com>:
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.
----------
assignee: docs at python
components: Documentation
messages: 412784
nosy: 97littleleaf11, AlexWaygood, Jelle Zijlstra, docs at python, sobolevn
priority: normal
severity: normal
status: open
title: TypedDict docs are incomplete
versions: Python 3.10, Python 3.11, Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46677>
_______________________________________
More information about the New-bugs-announce
mailing list