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 empty TypedDicts · Issue #105570 · 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 the following two ways of creating empty from typing import TypedDict T = TypedDict("T") T2 = TypedDict("T2", None) PitchUsers currently have four distinct options if they want to create an empty T = TypedDict("T") T2 = TypedDict("T2", None) T3 = TypedDict("T3", {}) class T4(TypedDict): ... Of these four options, only Deprecating, and eventually removing, the first two ways of constructing empty TypedDicts will allow us to simplify the code at runtime. It will also be less confusing for users. Every way in which the runtime and type checkers differ in behaviour is a potential point of confusion for users; in general, we should work to keep these points of difference to a minimum. I also don't think these methods of constructing empty TypedDicts are particularly common. 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:
In retrospect, we should really have deprecated these ways of creating empty TypedDicts at the same time. But there's no way of changing that now. Linked PRsActivity
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. |