-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-105509: Simplify the implementation of typing.Annotated
#105510
Conversation
typing.Annotated
typing.Annotated
Misc/NEWS.d/next/Library/2023-06-08-15-56-45.gh-issue-105509.YIG57j.rst
Outdated
Show resolved
Hide resolved
…IG57j.rst Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick note: right now it is possible to use Annotated
in isinstance(1, typing.Annotated)
. However, it does not make much sense anyway:
>>> isinstance(typing.Annotated[int, 1], typing.Annotated)
False
With this patch applied it will raise a TypeError
.
I don't think that it is a big deal.
Yeah. You can think up ways that this could break people's code, if they're doing strange things with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Couldn't find any isinstance(..., Annotated) in a quick search
Closes #105509
typing.Annotated
#105509