From fd66e1093053fca3c492d570d9e0359c5312d8ae Mon Sep 17 00:00:00 2001 From: KotlinIsland Date: Tue, 21 Jun 2022 11:00:35 +1000 Subject: [PATCH 1/3] gh-93626: Set the release for `__future__.annotations` to `None` --- Doc/whatsnew/3.11.rst | 8 ++++++++ Lib/__future__.py | 6 +++--- .../2022-06-09-14-44-21.gh-issue-93626.sfghs46.rst | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2022-06-09-14-44-21.gh-issue-93626.sfghs46.rst diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 9eafd6da13fa5d..2bd2d1c69ba28b 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -336,6 +336,14 @@ See :pep:`681` for more details. (Contributed by Jelle Zijlstra in :gh:`91860`. PEP written by Erik De Bonte and Eric Traut.) +Non-futures Related to Type Hints +--------------------------------- + +* :pep:`563` Postponed Evaluation of Annotations, ``__future__.annotations`` + that was planned for this release has been indefinitely postponed. + See `this message `_ for more information. + Other Language Changes ====================== diff --git a/Lib/__future__.py b/Lib/__future__.py index 97dc90c6e4644a..39720a5e4126cd 100644 --- a/Lib/__future__.py +++ b/Lib/__future__.py @@ -33,7 +33,7 @@ to use the feature in question, but may continue to use such imports. MandatoryRelease may also be None, meaning that a planned feature got -dropped. +dropped or that the release version is undetermined. Instances of class _Feature have two corresponding methods, .getOptionalRelease() and .getMandatoryRelease(). @@ -96,7 +96,7 @@ def getMandatoryRelease(self): """Return release in which this feature will become mandatory. This is a 5-tuple, of the same form as sys.version_info, or, if - the feature was dropped, is None. + the feature was dropped, or the release date is undetermined, is None. """ return self.mandatory @@ -143,5 +143,5 @@ def __repr__(self): CO_FUTURE_GENERATOR_STOP) annotations = _Feature((3, 7, 0, "beta", 1), - (3, 11, 0, "alpha", 0), + None, CO_FUTURE_ANNOTATIONS) diff --git a/Misc/NEWS.d/next/Library/2022-06-09-14-44-21.gh-issue-93626.sfghs46.rst b/Misc/NEWS.d/next/Library/2022-06-09-14-44-21.gh-issue-93626.sfghs46.rst new file mode 100644 index 00000000000000..c6fa103706e9cd --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-06-09-14-44-21.gh-issue-93626.sfghs46.rst @@ -0,0 +1 @@ +Set ``__future__.annotations`` to have a ``None`` mandatoryRelease to indicate that it is currently 'TBD'. From 6e0a02dac08a897e9bcee949bab183f2c1b5e399 Mon Sep 17 00:00:00 2001 From: KotlinIsland <65446343+KotlinIsland@users.noreply.github.com> Date: Tue, 5 Jul 2022 17:36:59 +1000 Subject: [PATCH 2/3] Update whatsnew Co-authored-by: Guido van Rossum --- Doc/whatsnew/3.11.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 2bd2d1c69ba28b..879cdfc020577e 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -336,8 +336,8 @@ See :pep:`681` for more details. (Contributed by Jelle Zijlstra in :gh:`91860`. PEP written by Erik De Bonte and Eric Traut.) -Non-futures Related to Type Hints ---------------------------------- +PEP 563 May Not Be the Future +----------------------------- * :pep:`563` Postponed Evaluation of Annotations, ``__future__.annotations`` that was planned for this release has been indefinitely postponed. From 997df436cc0454e223171260a728837cd2365d38 Mon Sep 17 00:00:00 2001 From: KotlinIsland <65446343+KotlinIsland@users.noreply.github.com> Date: Tue, 5 Jul 2022 17:37:13 +1000 Subject: [PATCH 3/3] Update whatsnew Co-authored-by: Guido van Rossum --- Doc/whatsnew/3.11.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 879cdfc020577e..d9a5efa34b414f 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -341,8 +341,7 @@ PEP 563 May Not Be the Future * :pep:`563` Postponed Evaluation of Annotations, ``__future__.annotations`` that was planned for this release has been indefinitely postponed. - See `this message `_ for more information. + See `this message `_ for more information. Other Language Changes ======================