From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 8 May 2022 15:04:18 +0000 (-0700) Subject: gh-92417: `typing` docs: `from __future__ import annotations` can be used in all... X-Git-Tag: v3.10.5~84 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=80ce70110b61db63a7dec33df59369b0b1b09144;p=thirdparty%2FPython%2Fcpython.git gh-92417: `typing` docs: `from __future__ import annotations` can be used in all supported Python versions (GH-92418) (cherry picked from commit e5b4bd4d60aaf0292c5b9d628512145b8987b3c6) Co-authored-by: Alex Waygood --- diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index bcf2b22b1a3c..9936f1a3e57c 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -2290,7 +2290,7 @@ Constant .. note:: - If ``from __future__ import annotations`` is used in Python 3.7 or later, + If ``from __future__ import annotations`` is used, annotations are not evaluated at function definition time. Instead, they are stored as strings in ``__annotations__``. This makes it unnecessary to use quotes around the annotation