| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| >>> time.fromisoformat('04:23:01.000384') | ||
| datetime.time(4, 23, 1, 384) | ||
| >>> time.fromisoformat('04:23:01,000') | ||
| >>> time.fromisoformat('04:23:01,000384') |
There was a problem hiding this comment.
I think the point of this example is to show the comma-plus-three-digits format, so you want to change the output, not the input.
Though maybe it's better to change this to 04:23:01,678 to make it clear that those are milliseconds
Sorry, something went wrong.
There was a problem hiding this comment.
There was only a little information for me to interpret the intention of the code example. Given that the returned value of the previous line was the same as this line, I can only guess that this line was meant to show that the comma is strictly equivalent to the dot as the delimiter for fractional seconds. Therefore, I decided to change the returned value of this line.
I think it would be more clear if there were separate examples of showing the equivalence of delimiters and showing the difference between two fractional seconds formats. If this was the case, I would like to keep the current change and add one more code example to demonstrate the 3-digits format for fractional seconds. For example:
>>> time.fromisoformat('04:23:01.384')
datetime.time(4, 23, 1, 384000)
Sorry, something went wrong.
There was a problem hiding this comment.
time.fromisoformat('04:23:01.384') was supported in 3.10, but neither time.fromisoformat('04:23:01,000384') nor time.fromisoformat('04:23:01,384') worked. So this new test was for comma, not for three-digits fraction part.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
| >>> time.fromisoformat('04:23:01.000384') | ||
| datetime.time(4, 23, 1, 384) | ||
| >>> time.fromisoformat('04:23:01,000') | ||
| >>> time.fromisoformat('04:23:01,000384') |
There was a problem hiding this comment.
time.fromisoformat('04:23:01.384') was supported in 3.10, but neither time.fromisoformat('04:23:01,000384') nor time.fromisoformat('04:23:01,384') worked. So this new test was for comma, not for three-digits fraction part.
Sorry, something went wrong.
|
Although this PR was opened first, a fix was already merged with the close of issue #112925. :( |
Sorry, something went wrong.
|
In any way the problem is solved. Thank you for your PR @mikelei8291. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The example code was intended to show that the comma was a valid delimiter for fractional seconds, but the returned datetime.time object was not consistent with the specified parameter.
The example was added in #92177.