From: Ivan Levkivskyi Date: Wed, 19 Jun 2019 01:02:15 +0000 (+0100) Subject: [3.7] bpo-36985: Document typing.ForwardRef (GH-14216) (GH-14220) X-Git-Tag: v3.7.5rc1~326 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0587353fe2dece91d2a9b8ddf2696fb5adc233a;p=thirdparty%2FPython%2Fcpython.git [3.7] bpo-36985: Document typing.ForwardRef (GH-14216) (GH-14220) https://bugs.python.org/issue36985 --- diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 12f4c03f4232..5adc81c1e3c8 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -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,