[Python-checkins] Document typing.ForwardRef (GH-14216)

Miss Islington (bot) webhook-mailer at python.org
Tue Jun 18 20:38:47 EDT 2019


https://github.com/python/cpython/commit/fff695b9abaa1075ceee95880dba26307df1e7e5
commit: fff695b9abaa1075ceee95880dba26307df1e7e5
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-06-18T17:38:43-07:00
summary:

Document typing.ForwardRef (GH-14216)

(cherry picked from commit 809ff1181ccc09c3b629f3d0ec66e13eaa111b2e)

Co-authored-by: Ivan Levkivskyi <levkivskyi at gmail.com>

files:
M Doc/library/typing.rst

diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 1a766c29a57a..d2dd03d50fc6 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -1001,6 +1001,13 @@ The module defines the following classes, functions and decorators:
 
    .. 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)
 
    A helper function to indicate a distinct types to a typechecker,



More information about the Python-checkins mailing list