mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.12] gh-112925: Fix error in example of datetime.time.fromisoformat
and add doctest marker (GH-112931) (GH-113427)
(cherry picked from commit bdc8d667ab
)
Co-authored-by: F-park <52167622+F-park@users.noreply.github.com>
This commit is contained in:
parent
c7874bb56f
commit
fee2bc15f9
1 changed files with 3 additions and 1 deletions
|
@ -1793,6 +1793,8 @@ Other constructor:
|
|||
|
||||
Examples::
|
||||
|
||||
.. doctest::
|
||||
|
||||
>>> from datetime import time
|
||||
>>> time.fromisoformat('04:23:01')
|
||||
datetime.time(4, 23, 1)
|
||||
|
@ -1802,7 +1804,7 @@ Other constructor:
|
|||
datetime.time(4, 23, 1)
|
||||
>>> time.fromisoformat('04:23:01.000384')
|
||||
datetime.time(4, 23, 1, 384)
|
||||
>>> time.fromisoformat('04:23:01,000')
|
||||
>>> time.fromisoformat('04:23:01,000384')
|
||||
datetime.time(4, 23, 1, 384)
|
||||
>>> time.fromisoformat('04:23:01+04:00')
|
||||
datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue