gh-115225: Parsing fractions correctly in datetime.time.fromisoformat#115313
Closed
ba-13 wants to merge 8 commits intopython:mainfrom
ba-13:fix-issue-115225
Closed
gh-115225: Parsing fractions correctly in datetime.time.fromisoformat#115313ba-13 wants to merge 8 commits intopython:mainfrom ba-13:fix-issue-115225
ba-13 wants to merge 8 commits intopython:mainfrom
ba-13:fix-issue-115225
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Member
|
I commented in #115225, but I believe the correct approach here is to raise |
Author
|
@pganssle I'll change it to throw ValueError then. |
Member
|
This was implemented in #119339. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue#115225 is regarding the incorrect behavior of
datetime.time.fromisoformat.@xitop points out in ISO8601 specified that a decimal fraction may be added to the lowest-order time element present. The OP also mentions that the current docs says fractional minutes/hours are not supported, and recommends to throw
ValueError.I found the current version had tried to parse fractional quantities somewhat but incorrectly, so I opted for including fractional time element and not raising an exception. Changed
Lib/_pydatetime.pyandModules/_datetimemodule.c. Alldatetimetests are ok.