From b0c9bfa2ff5334dee7d587d093eaf83593cca98b Mon Sep 17 00:00:00 2001 From: Tomas R Date: Fri, 26 May 2023 08:34:17 +0200 Subject: [PATCH] gh-104943: Remove mentions of old Python versions (GH-104945) (cherry picked from commit 46857d0b2a2ac6aeb6dcce2bf2c92ddf4abe7496) Co-authored-by: Tomas R --- Lib/typing.py | 5 +---- .../2023-05-25-22-34-31.gh-issue-104943.J2v1Pc.rst | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Documentation/2023-05-25-22-34-31.gh-issue-104943.J2v1Pc.rst diff --git a/Lib/typing.py b/Lib/typing.py index 921542f49c3242..814020b872f585 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -2876,7 +2876,7 @@ def __new__(cls, typename, bases, ns): def NamedTuple(typename, fields=None, /, **kwargs): """Typed version of namedtuple. - Usage in Python versions >= 3.6:: + Usage:: class Employee(NamedTuple): name: str @@ -2893,9 +2893,6 @@ class Employee(NamedTuple): Employee = NamedTuple('Employee', name=str, id=int) - In Python versions <= 3.5 use:: - - Employee = NamedTuple('Employee', [('name', str), ('id', int)]) """ if fields is None: fields = kwargs.items() diff --git a/Misc/NEWS.d/next/Documentation/2023-05-25-22-34-31.gh-issue-104943.J2v1Pc.rst b/Misc/NEWS.d/next/Documentation/2023-05-25-22-34-31.gh-issue-104943.J2v1Pc.rst new file mode 100644 index 00000000000000..bc4d03b8e95f86 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2023-05-25-22-34-31.gh-issue-104943.J2v1Pc.rst @@ -0,0 +1 @@ +Remove mentions of old Python versions in :class:`typing.NamedTuple`.