PEP 835: Shorthand syntax for Annotated type metadata#4995
PEP 835: Shorthand syntax for Annotated type metadata#4995till-varoquaux wants to merge 7 commits into
Conversation
|
@ilevkivskyi The draft is up and ready for your official sponsorship sign-off whenever you have a moment! |
Documentation build overview
750 files changed ·
|
ilevkivskyi
left a comment
There was a problem hiding this comment.
The draft LG! But please take a look at comments by @JelleZijlstra
b646aa7 to
c237409
Compare
|
Thanks so much for the review and the help getting this staged, @JelleZijlstra and @ilevkivskyi ! Since my sponsor (@ilevkivskyi) has officially signed off on the draft, could one of the PEP editors go ahead and assign this an official PEP number? Let me know if there is anything else needed from my end before we can get this merged and move the conversation over to Discourse. |
Please use 835. |
|
Thanks for the help, @hugovk! Really appreciate you sorting out the syntax highlighting, The file rename is done, the |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
a3ddef4 to
9580655
Compare
This PR introduces a draft PEP proposing a shorthand syntax for
typing.Annotatedusing the@operator (e.g.,x: int @ "metadata"instead oftyping.Annotated[int, "metadata"]).This proposal aims to improve the developer ergonomics of metadata-heavy typing frameworks like Pydantic, FastAPI, and SQLModel, aligning Python's type annotations with the conciseness of JVM languages (Java, Kotlin).
All prototype implementations (CPython, Mypy, Pyright, Ruff) are complete and linked in the Reference Implementation section.
Basic requirements (all PEP Types)
pep-NNNN.rst), PR title (PEP 123: <Title of PEP>) andPEPheaderAuthororSponsor, and formally confirmed their approvalAuthor,Status(Draft),TypeandCreatedheaders filled out correctlyPEP-Delegate,Topic,RequiresandReplacesheaders completed if appropriate.github/CODEOWNERSfor the PEPStandards Track requirements
Python-Versionset to valid (pre-beta) future Python version, if relevantDiscussions-ToandPost-History