Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indentation in TypedDict docs #352

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 22 additions & 22 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -396,37 +396,37 @@ Special typing primitives

.. versionadded:: 4.9.0

The experimental ``closed`` keyword argument and the special key
``__extra_items__`` proposed in :pep:`728` are supported.
The experimental ``closed`` keyword argument and the special key
``__extra_items__`` proposed in :pep:`728` are supported.

When ``closed`` is unspecified or ``closed=False`` is given,
``__extra_items__`` behaves like a regular key. Otherwise, this becomes a
special key that does not show up in ``__readonly_keys__``,
``__mutable_keys__``, ``__required_keys__``, ``__optional_keys``, or
``__annotations__``.
When ``closed`` is unspecified or ``closed=False`` is given,
``__extra_items__`` behaves like a regular key. Otherwise, this becomes a
special key that does not show up in ``__readonly_keys__``,
``__mutable_keys__``, ``__required_keys__``, ``__optional_keys``, or
``__annotations__``.

For runtime introspection, two attributes can be looked at:
For runtime introspection, two attributes can be looked at:

.. attribute:: __closed__
.. attribute:: __closed__

A boolean flag indicating whether the current ``TypedDict`` is
considered closed. This is not inherited by the ``TypedDict``'s
subclasses.
A boolean flag indicating whether the current ``TypedDict`` is
considered closed. This is not inherited by the ``TypedDict``'s
subclasses.

.. versionadded:: 4.10.0
.. versionadded:: 4.10.0

.. attribute:: __extra_items__
.. attribute:: __extra_items__

The type annotation of the extra items allowed on the ``TypedDict``.
This attribute defaults to ``None`` on a TypedDict that has itself and
all its bases non-closed. This default is different from ``type(None)``
that represents ``__extra_items__: None`` defined on a closed
``TypedDict``.
The type annotation of the extra items allowed on the ``TypedDict``.
This attribute defaults to ``None`` on a TypedDict that has itself and
all its bases non-closed. This default is different from ``type(None)``
that represents ``__extra_items__: None`` defined on a closed
``TypedDict``.

If ``__extra_items__`` is not defined or inherited on a closed
``TypedDict``, this defaults to ``Never``.
If ``__extra_items__`` is not defined or inherited on a closed
``TypedDict``, this defaults to ``Never``.

.. versionadded:: 4.10.0
.. versionadded:: 4.10.0

.. versionchanged:: 4.3.0

Expand Down