mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Document typing.ForwardRef (GH-14216)
This commit is contained in:
parent
47c2de7725
commit
809ff1181c
1 changed files with 7 additions and 0 deletions
|
|
@ -1001,6 +1001,13 @@ The module defines the following classes, functions and decorators:
|
||||||
|
|
||||||
.. versionadded:: 3.8
|
.. versionadded:: 3.8
|
||||||
|
|
||||||
|
.. class:: ForwardRef
|
||||||
|
|
||||||
|
A class used for internal typing representation of string forward references.
|
||||||
|
For example, ``List["SomeClass"]`` is implicitly transformed into
|
||||||
|
``List[ForwardRef("SomeClass")]``. This class should not be instantiated by
|
||||||
|
a user, but may be used by introspection tools.
|
||||||
|
|
||||||
.. function:: NewType(typ)
|
.. function:: NewType(typ)
|
||||||
|
|
||||||
A helper function to indicate a distinct types to a typechecker,
|
A helper function to indicate a distinct types to a typechecker,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue