]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.7] bpo-36985: Document typing.ForwardRef (GH-14216) (GH-14220)
authorIvan Levkivskyi <levkivskyi@gmail.com>
Wed, 19 Jun 2019 01:02:15 +0000 (02:02 +0100)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 19 Jun 2019 01:02:15 +0000 (18:02 -0700)
https://bugs.python.org/issue36985

Doc/library/typing.rst

index 12f4c03f4232b868eacbc9f99990fb4934464532..5adc81c1e3c8c4a5617ce3f83c5e642bf1179359 100644 (file)
@@ -876,6 +876,13 @@ The module defines the following classes, functions and decorators:
    .. versionchanged:: 3.6.1
       Added support for default values, methods, and docstrings.
 
+.. 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)
 
    A helper function to indicate a distinct types to a typechecker,