Skip to content

Commit fee2bc1

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

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

17941794
Examples::
17951795

1796+
.. doctest::
1797+
17961798
>>> from datetime import time
17971799
>>> time.fromisoformat('04:23:01')
17981800
datetime.time(4, 23, 1)
@@ -1802,7 +1804,7 @@ Other constructor:
18021804
datetime.time(4, 23, 1)
18031805
>>> time.fromisoformat('04:23:01.000384')
18041806
datetime.time(4, 23, 1, 384)
1805-
>>> time.fromisoformat('04:23:01,000')
1807+
>>> time.fromisoformat('04:23:01,000384')
18061808
datetime.time(4, 23, 1, 384)
18071809
>>> time.fromisoformat('04:23:01+04:00')
18081810
datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy