-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
bpo-38979: fix ContextVar "__class_getitem__" method #17497
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
bpo-38979: fix ContextVar "__class_getitem__" method #17497
Conversation
@@ -0,0 +1,3 @@ | |||
return class from __class_getitem__ to simplify subclassing. E.g. `clss = | |||
contextvars.ContextVar[str]` returned `None` instead of `<class |
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.
IMHO there is no need for examples for this fix
cpython/Lib/test/test_context.py Lines 41 to 42 in 26ab478
You need to remove this test |
@@ -0,0 +1,3 @@ | |||
return class from __class_getitem__ to simplify subclassing. E.g. `clss = |
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.
You might want to use double backtick for __class_getitem__
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.
I agree with both @isidentical comments. @amiremohamadi please address them.
Otherwise, the PR looks awesome.
@@ -0,0 +1,3 @@ | |||
return class from __class_getitem__ to simplify subclassing. E.g. `clss = |
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.
I agree with both @isidentical comments. @amiremohamadi please address them.
Otherwise, the PR looks awesome.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Since It cannot break any code. |
@asvetlov, @isidentical thanks for your help! :) |
Thanks for making the requested changes! @asvetlov: please review the changes made to this pull request. |
@amiremohamadi: Status check is done, and it's a success ✅ . |
Thanks @amiremohamadi for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None. https://bugs.python.org/issue38979 Automerge-Triggered-By: @asvetlov (cherry picked from commit 28c9163) Co-authored-by: AMIR <[email protected]>
GH-17505 is a backport of this pull request to the 3.8 branch. |
GH-17506 is a backport of this pull request to the 3.7 branch. |
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None. https://bugs.python.org/issue38979 Automerge-Triggered-By: @asvetlov (cherry picked from commit 28c9163) Co-authored-by: AMIR <[email protected]>
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None. https://bugs.python.org/issue38979 Automerge-Triggered-By: @asvetlov (cherry picked from commit 28c9163) Co-authored-by: AMIR <[email protected]>
Thanks @amiremohamadi for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
GH-17507 is a backport of this pull request to the 3.8 branch. |
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None. https://bugs.python.org/issue38979 Automerge-Triggered-By: @asvetlov (cherry picked from commit 28c9163) Co-authored-by: AMIR <[email protected]>
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None. https://bugs.python.org/issue38979 Automerge-Triggered-By: @asvetlov (cherry picked from commit 28c9163) Co-authored-by: AMIR <[email protected]>
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None. https://bugs.python.org/issue38979 Automerge-Triggered-By: @asvetlov
now contextvars.ContextVar "class_getitem" method returns ContextVar class, not None.
https://bugs.python.org/issue38979
Automerge-Triggered-By: @asvetlov