Skip to content

bpo-46491: Allow Annotated on outside of Final/ClassVar #30864

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

Merged
merged 6 commits into from
Jan 25, 2022

Conversation

GBeauregard
Copy link
Contributor

@GBeauregard GBeauregard commented Jan 24, 2022

We treat Annotated type arg as class-level annotation. This exempts it from checks against Final and ClassVar in order to allow using them in any nesting order.

https://bugs.python.org/issue46491

Automerge-Triggered-By: GH:gvanrossum

This exempts it from checks against Final and ClassVar in order to allow
using them in any nesting order.
Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! A few comments.

@gvanrossum
Copy link
Member

Please add me back once this is ready to merge.

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gvanrossum I think this is ready now.

@gvanrossum
Copy link
Member

Maybe this should be backported?

@JelleZijlstra JelleZijlstra added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Jan 25, 2022
@JelleZijlstra
Copy link
Member

Agree, I added the labels

@miss-islington
Copy link
Contributor

@GBeauregard: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit e1abffc into python:main Jan 25, 2022
@miss-islington
Copy link
Contributor

Thanks @GBeauregard for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Jan 25, 2022
@bedevere-bot
Copy link

GH-30873 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 25, 2022
We treat Annotated type arg as class-level annotation. This exempts it from checks against Final and ClassVar in order to allow using them in any nesting order.

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit e1abffc)

Co-authored-by: Gregory Beauregard <greg@greg.red>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 25, 2022
We treat Annotated type arg as class-level annotation. This exempts it from checks against Final and ClassVar in order to allow using them in any nesting order.

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit e1abffc)

Co-authored-by: Gregory Beauregard <greg@greg.red>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Jan 25, 2022
@bedevere-bot
Copy link

GH-30874 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit that referenced this pull request Jan 25, 2022
We treat Annotated type arg as class-level annotation. This exempts it from checks against Final and ClassVar in order to allow using them in any nesting order.

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit e1abffc)

Co-authored-by: Gregory Beauregard <greg@greg.red>
miss-islington added a commit that referenced this pull request Jan 25, 2022
We treat Annotated type arg as class-level annotation. This exempts it from checks against Final and ClassVar in order to allow using them in any nesting order.

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit e1abffc)

Co-authored-by: Gregory Beauregard <greg@greg.red>
@GBeauregard GBeauregard deleted the fix-issue-46491 branch February 6, 2022 09:02
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
We treat Annotated type arg as class-level annotation. This exempts it from checks against Final and ClassVar in order to allow using them in any nesting order.

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit e1abffc)

Co-authored-by: Gregory Beauregard <greg@greg.red>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants