-
-
Notifications
You must be signed in to change notification settings - Fork 36.6k
Simplify the implementation of typing.Annotated #105509
Copy link
Copy link
Closed
Labels
3.13bugs and security fixesbugs and 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
Description
Activity
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and 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
Feature or enhancement
typing.Annotatedis currently implemented as a class, but doesn't need to be. All other objects like it in thetypingmodule are implemented as instances oftyping._SpecialForm, and we can do the same here. This simplifies the code a lot (making it easier to maintain in the future), and should also be slightly more performant.Linked PRs
typing.Annotated#105510