Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use bullet list
  • Loading branch information
97littleleaf11 committed Feb 13, 2022
commit 15a7930fef47f604ca59acbcf6a6670a9a296dc2
8 changes: 4 additions & 4 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1388,13 +1388,13 @@ These are not used in annotations. They are building blocks for declaring types.
``Point2D.__total__``, ``Point2D.__required_keys__``, and
``Point2D.__optional_keys__``.
To allow using this feature with older versions of Python that do not
support :pep:`526`, ``TypedDict`` supports two additional equivalent
syntactic forms. Firstly, using a literal :class:`dict` as the
second argument::
support :pep:`526`, ``TypedDict`` can be created using a functional form:
Comment thread
97littleleaf11 marked this conversation as resolved.
Outdated

* Using a literal :class:`dict` as the second argument::

Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

Secondly, using keyword arguments::
* Using keyword arguments::

Point2D = TypedDict('Point2D', x=int, y=int, label=str)

Expand Down