8000 [3.11] gh-112925: Fix error in example of `datetime.time.fromisoforma… · python/cpython@0bd134d · GitHub
[go: up one dir, main page]

Skip to content

Commit 0bd134d

Browse files
[3.11] gh-112925: Fix error in example of datetime.time.fromisoformat and add doctest marker (GH-112931) (GH-113428)
(cherry picked from commit bdc8d66) Co-authored-by: F-park <52167622+F-park@users.noreply.github.com>
1 parent e59ad57 commit 0bd134d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Doc/library/datetime.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,8 @@ Other constructor:
17851785

17861786
Examples::
17871787

1788+
.. doctest::
1789+
17881790
>>> from datetime import time
17891791
>>> time.fromisoformat('04:23:01')
17901792
datetime.time(4, 23, 1)
@@ -1794,7 +1796,7 @@ Other constructor:
17941796
datetime.time(4, 23, 1)
17951797
>>> time.fromisoformat('04:23:01.000384')
17961798
datetime.time(4, 23, 1, 384)
1797-
>>> time.fromisoformat('04:23:01,000')
1799+
>>> time.fromisoformat('04:23:01,000384')
17981800
datetime.time(4, 23, 1, 384)
17991801
>>> time.fromisoformat('04:23:01+04:00')
18001802
datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))

0 commit comments

Comments
 (0)
0