Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-41428: Implementation for PEP 604 #21515
Conversation
This comment has been hidden.
This comment has been hidden.
Thank you so much! Give me a few days to review this. Ping me if you haven't heard from me by Wednesday! |
Great start! Here's a boatload of review comments, from whitespace nits to feature requests. |
(Presumably you were going to add more commits before asking for another review?) |
@gvanrossum thanks so much for the comments! I'll implement your suggestions and clean this up :) |
goto done; | ||
} | ||
|
||
if (_PyObject_LookupAttrId(p, &PyId___origin__, &tmp) < 0) { |
pablogsal
Aug 17, 2020
Member
It seems to me like we're also updating the
tmp
variable here, and using it later in the function.
But you throw it away inmediatele:
if (tmp != NULL) {
Py_DECREF(tmp);
and then you substitute it for another one:
if (_PyObject_LookupAttrId(p, &PyId___args__, &tmp) < 0) {
goto exit;
that then you throw away immediately:
if (tmp != NULL) {
Py_DECREF(tmp);
- Use goto target to reduce code repetition. - Fix style nits. - Rename method check_args -> is_generic_alias_in_args. - Fix potential reference leaks. - Check for error result from is_unionable. - Small refactor to repr method
Yup, this was how it worked. I refactored so when calling @pablogsal thanks for another round of reviews :) |
I had thought of another case we might need to handle here, and was hoping to get your input. Should this:
evaluate to true? |
@pablogsal let me know if there are any other changes you'd like to see here. |
I just need to find some time to do another iteration |
@MaggieMoss I have pushed a new commit (8c06c1d) to do some simplifications and to fix some minor reference count issues and crashes. Please, check out that everything seems ok in that commit :) |
This looks good to me! Thanks for all the work and patience @MaggieMoss! Great job :) @gvanrossum I won't land it myself in case you or Maggie want to take a last check. |
I think it's good! Thanks so much Maggie for all your work. |
Thanks so much for all of your reviews and comments, I've really appreciated it. |
@MaggieMoss "test.test_asyncio.test_sendfile.ProactorEventLoopTests.test_sendfile_close_peer_in_the_middle_of_receiving" |
That's an unrelated race condition in asyncio in Windows, we can ignore it and just land |
1b4552c
into
python:master
Congrats Maggie!!
|
PEP 604 - Proposed Implementation
https://www.python.org/dev/peps/pep-0604/
Building off of the comments left on this PR here: https://github.com/pprados/cpython/tree/PEP604
https://bugs.python.org/issue41428