GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-64376: Use Argument Clinic for datetime.date classmethods by hauntsaninja · Pull Request #20208 · python/cpython Conversation
|
|
Re: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Two small notes:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Indeed, it's good to keep these Argument Clinic conversions as straightforward as possible. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing and re-opening to restart the hanged Travis-CI check. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks, looks like everything's green :-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Needs a few tweaks but overall looks good.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| (2<<32, 1, 1), | ||
| (2019, 2<<32, 1), | ||
| (2019, 1, 2<<32), |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why are these removed?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I mentioned this in a PR comment:
Re: datetime.date.fromisocalendar
Note that this now can throw OverflowError instead of ValueError when
using the C version of datetime. There is precedent for this, e.g.,
datetime.date.fromordinal will throw an OverflowError with the C module
but ValueError with the Python.
Also, prior to this PR, the C version fromisocalendar would throw a ValueError while the Python version throws TypeError for issues with e.g, missing arguments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks, I didn't make the connection! I'll take another look at that.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Tal Einat <[email protected]>
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! :-)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
In my opinion this is fine, huge PRs can be hard to work with. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (PyErr_ExceptionMatches(PyExc_OverflowError)) { | ||
| PyErr_Format(PyExc_ValueError, | ||
| "ISO calendar component out of range"); | ||
| year: int | ||
| week: int | ||
| day: int | ||
|
|
||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Now I see that before this PR we have code in fromisocalendar() to raise ValueError rather than OverflowError. Raising a ValueError seems like better behavior to me. Also, changing this would be considered backwards-incompatible, would require NEWS and What's New entries, and couldn't be backported.
I think we should find a way to retain this behavior, even if that means not using Argument Clinic for this method right now.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
To respond to all points re. types of exceptions raised:
As I stated above, I suggest keeping the behavior of raising ValueError rather than OverflowError.
Changing this to raise ValueError instead of OverflowError would be an improvement IMO.
These inconsistencies are unfortunate, but relatively minor. If this PR fixes that, adding a test for it would be great! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@hauntsaninja could you fix merge conflicts, please? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.