Skip to content

Commit d058735

Browse files
ilevkivskyimiss-islington
authored andcommitted
[3.7] bpo-36985: Document typing.ForwardRef (GH-14216) (GH-14220)
https://bugs.python.org/issue36985
1 parent 44d46e3 commit d058735

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/library/typing.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,13 @@ The module defines the following classes, functions and decorators:
876876
.. versionchanged:: 3.6.1
877877
Added support for default values, methods, and docstrings.
878878

879+
.. class:: ForwardRef
880+
881+
A class used for internal typing representation of string forward references.
882+
For example, ``List["SomeClass"]`` is implicitly transformed into
883+
``List[ForwardRef("SomeClass")]``. This class should not be instantiated by
884+
a user, but may be used by introspection tools.
885+
879886
.. function:: NewType(typ)
880887

881888
A helper function to indicate a distinct types to a typechecker,

0 commit comments

Comments
 (0)