mirror of
https://github.com/python/cpython.git
synced 2026-05-16 15:30:48 +00:00
[3.11] gh-94439: typing docs: Add minimum version to __required_keys__ and __optional_keys__ (GH-95373) (#95944)
Co-authored-by: Howie Zhao <howiezhaohr@hotmail.com>
This commit is contained in:
parent
63690996e8
commit
1fccb1d493
1 changed files with 5 additions and 0 deletions
|
|
@ -1825,6 +1825,9 @@ These are not used in annotations. They are building blocks for declaring types.
|
|||
True
|
||||
|
||||
.. attribute:: __required_keys__
|
||||
|
||||
.. versionadded:: 3.9
|
||||
|
||||
.. attribute:: __optional_keys__
|
||||
|
||||
``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return
|
||||
|
|
@ -1852,6 +1855,8 @@ These are not used in annotations. They are building blocks for declaring types.
|
|||
>>> Point3D.__optional_keys__ == frozenset({'x', 'y'})
|
||||
True
|
||||
|
||||
.. versionadded:: 3.9
|
||||
|
||||
See :pep:`589` for more examples and detailed rules of using ``TypedDict``.
|
||||
|
||||
.. versionadded:: 3.8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue