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 — bpo-36004: Add date.fromisocalendar by pganssle · Pull Request #11888 · python/cpython Conversation
|
|
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.
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.
221f2a7 to
3d3e6e7
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
One thing I'll note is that this is consistent with datetime.date itself not accepting floats. I'm not sure how much I agree with that, I just wanted to put it in the tests to ensure consistency between the C and Python versions.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I have made the requested changes; please review again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @pablogsal: please review the changes made to this pull request. |
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 think we are missing an entry in Doc/whatsnew/3.8.rst
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ba63b21 to
44f9adf
Compare
There was an error while loading. Please reload this page.
|
@pablogsal Indeed, I'm so used to adding these after the fact, it might be nice to actually have one merged with the change for once. Added. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
44f9adf to
889f58c
Compare
889f58c to
a9ba64d
Compare
a9ba64d to
c514f03
Compare
c514f03 to
5f40dd5
Compare
Dismissed my review while I have to do another one to not block the PR
5f40dd5 to
535a713
Compare
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.
Maybe use MINYEAR/MAXYEAR here.
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.
Instead of converting these over, I have just added a MINYEAR and MAXYEAR test. Even though it's redundant, I like to have the explicit callout of the current boundaries, so that if MINYEAR or MAXYEAR get modified in a way that breaks backwards compatibility, it will raise an error.
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.
Would it be possible to use 3 loops to test all combinations, rather than generate these combinations manualy?
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.
OK, I've converted it over. I think it's a little harder to understand what's going on in the version where the test cases are generated (compared to manual), but using a loop also has its advantages.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I forgot to say that more generally, I like the idea. I like the proposed new constructor, it perfectly makes sense. I just have some comments on the actual implementation. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This commit implements the first version of date.fromisocalendar, the inverse function for date.isocalendar. It is currently missing error checking for the case of of invalid iso dates in week 53. bpo-36004: https://bugs.python.org/issue36004
This avoids an overflow error in ordinal calculations in the C implementation.
All overflow errors in this context are also value errors, so it is preferable to be uniform in the type of error raised.
This is equivalent but uses only existing helper functions and in many cases will be slightly more efficient.
535a713 to
3307865
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Side note: @pganssle: maybe it would be interesting to convert datetime to Argument Clinic to provide better docstrings.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Random network issue, unrelated to this change. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@vstinner Thanks for the review and merge, Victor! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* Clarify impact on default behaviour of exec, eval, etc * Update documentation for changes to PyEval_GetLocals (pythongh-74929) Closes pythongh-11888
* Clarify impact on default behaviour of exec, eval, etc * Update documentation for changes to PyEval_GetLocals (pythongh-74929) Closes pythongh-11888 (cherry picked from commit 2180991) Co-authored-by: Alyssa Coghlan <[email protected]>
* Clarify impact on default behaviour of exec, eval, etc * Update documentation for changes to PyEval_GetLocals (pythongh-74929) Closes pythongh-11888
* Clarify impact on default behaviour of exec, eval, etc * Update documentation for changes to PyEval_GetLocals (pythongh-74929) Closes pythongh-11888
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.