Skip to content

Commit bdc8d66

Browse files
authored
gh-112925: Fix error in example of datetime.time.fromisoformat and add doctest marker (GH-112931)
1 parent 4e5b27e commit bdc8d66

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
@@ -1799,6 +1799,8 @@ Other constructor:
17991799

18001800
Examples::
18011801

1802+
.. doctest::
1803+
18021804
>>> from datetime import time
18031805
>>> time.fromisoformat('04:23:01')
18041806
datetime.time(4, 23, 1)
@@ -1808,7 +1810,7 @@ Other constructor:
18081810
datetime.time(4, 23, 1)
18091811
>>> time.fromisoformat('04:23:01.000384')
18101812
datetime.time(4, 23, 1, 384)
1811-
>>> time.fromisoformat('04:23:01,000')
1813+
>>> time.fromisoformat('04:23:01,000384')
18121814
datetime.time(4, 23, 1, 384)
18131815
>>> time.fromisoformat('04:23:01+04:00')
18141816
datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))

0 commit comments

Comments
 (0)