GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Deprecate unusual ways of creating `typing.NamedTuple` classes · Issue #105566 · python/cpython Closed Labels 3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-typingtype-featureA feature request or enhancementA feature request or enhancement DescriptionFeature or enhancementI propose that we deprecate in Python 3.13 the following unusual ways of constructing a from typing import NamedTuple Foo = NamedTuple("Foo", x=int, y=int) # NamedTuple with "x" and "y" fields Bar = NamedTuple("Bar") # empty NamedTuple Baz = NamedTuple("Baz", None) # empty NamedTuple Eggs = NamedTuple("Eggs", fields=None) # empty NamedTuple Pitch
Deprecating, and eventually removing, these ways of constructing These methods of constructing Foo = NamedTuple("Foo", [("x", int), ("y", int)]) If you want to construct an empty Bar = NamedTuple("Bar", []) class Baz(NamedTuple): ... Previous discussionFor very similar reasons, we previously deprecated and removed the keyword-argument syntax for creating TypedDicts. This was deprecated in 3.11, and removed in 3.13:
Linked PRsReacted by Jelle Zijlstra, Shantanu and sobolevn Activity
MetadataMetadataAssigneesLabels3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-typingtype-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |