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

Clarify "Using types...but not at runtime" docs #15029

Merged
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
Update with suggested rewording.
  • Loading branch information
jonshea committed Apr 11, 2023
commit ddf8a3b8c54ffea2be472d154c1db1513b58d02f
8 changes: 3 additions & 5 deletions docs/source/runtime_troubles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,9 @@ sections, these can be dealt with by using :ref:`typing.TYPE_CHECKING

def f(x: SupportsRichComparison) -> None

Note that the ``from __future__ import annotations`` is required to avoid
a ``NameError`` at the use site of the excluded import. In the example above,
``def f(x: SupportsRichComparison)`` would raise ``NameError`` if
``from __future__ import annotations`` is not included. For more information,
and additional caveats, see the section on
The ``from __future__ import annotations`` is required to avoid
a ``NameError`` when using the imported symbol.
For more information and caveats, see the section on
:ref:`future annotations <future-annotations>`.

.. _generic-builtins:
Expand Down