[3.7] bpo-36985: Document typing.ForwardRef (GH-14216) (GH-14220) · python/cpython@d058735

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,