| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@ambv @Fidget-Spinner any chance to get a review please? 🙂 |
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry about the delay and thanks for your fix! This looks mostly good to me. I just have a few concerns.
Sorry, something went wrong.
|
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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request. |
Sorry, something went wrong.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
|
Thanks for making the requested changes! @Fidget-Spinner: please review the changes made to this pull request. |
Sorry, something went wrong.
There was a problem hiding this comment.
Very good insight about the need for is_class=. I have one change here that we need to make (the __init__ signature) and two suggestions which I think make things clearer.
Sorry, something went wrong.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
There was a problem hiding this comment.
Thanks for your changes. I only have one more nit about adding a docstring :).
Sorry, something went wrong.
| @@ -0,0 +1,7 @@ | |||
| # Tests that top-level ClassVar is not allowed | |||
|
|
|||
| from __future__ import annotations | |||
There was a problem hiding this comment.
Interestingly, this test fails when you remove this import. So it still allows top-level ClassVar if they aren't strings.
If you'd like to forbid this, you probably need to create another issue/and or PR. This behavior is what typing currently does (since 3.7-3.10). Even if the behavior is wrong, we don't usually backport bugfixes that add extra restrictions (unless it's a security fix) because that usually breaks backwards compatibility.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, good catch! I've opened a new issue: https://bugs.python.org/issue45283
I will work on it after this one will be finished.
Thanks! 👍
Sorry, something went wrong.
| if not is_class: | ||
| invalid_generic_forms += (ClassVar,) | ||
| if is_argument: | ||
| invalid_generic_forms += (Final,) |
There was a problem hiding this comment.
Note to self: there's a subtle change in the logic compared to the old code, but it's ok because is_argument defaulted to True in both ForwardRef and _type_check. Which means by default we should always add ClassVar too.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. Thanks for your patience!
Sorry, something went wrong.
|
This test_asyncio is failing sometimes on Windows, reruning the CI. |
Sorry, something went wrong.
|
Sorry, @sobolevn and @ambv, I could not cleanly backport this to 3.9 due to a conflict. |
Sorry, something went wrong.
|
GH-28560 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit 784905d) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
GH-28561 is a backport of this pull request to the 3.9 branch. |
Sorry, something went wrong.
|
Thanks everyone! 🎉 |
Sorry, something went wrong.
|
Don't mention it, thank you for the fix! |
Sorry, something went wrong.
|
Just a question: will this not be backported to Python 3.8 as well? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue45166