summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-12-23 10:50:19 (GMT)
committerGitHub <noreply@github.com>2023-12-23 10:50:19 (GMT)
commit0bd134d15f48dc5e284f13f1545548cabf50c792 (patch)
tree1fca830be3ca9a367e1fafc37749c0c97a917d88
parente59ad5796edd900170db5362878d1349046a0850 (diff)
downloadcpython-0bd134d15f48dc5e284f13f1545548cabf50c792.zip
cpython-0bd134d15f48dc5e284f13f1545548cabf50c792.tar.gz
cpython-0bd134d15f48dc5e284f13f1545548cabf50c792.tar.bz2
[3.11] gh-112925: Fix error in example of `datetime.time.fromisoformat` and add doctest marker (GH-112931) (GH-113428)
(cherry picked from commit bdc8d667ab545ccec0bf8c2769f5c5573ed293ea) Co-authored-by: F-park <52167622+F-park@users.noreply.github.com>
-rw-r--r--Doc/library/datetime.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
index 5ffaae9..28a366c 100644
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -1785,6 +1785,8 @@ Other constructor:
Examples::
+ .. doctest::
+
>>> from datetime import time
>>> time.fromisoformat('04:23:01')
datetime.time(4, 23, 1)
@@ -1794,7 +1796,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)))