From: F-park <52167622+F-park@users.noreply.github.com> Date: Sat, 23 Dec 2023 10:44:27 +0000 (+0800) Subject: gh-112925: Fix error in example of `datetime.time.fromisoformat` and add doctest... X-Git-Tag: v3.13.0a3~279 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdc8d667ab545ccec0bf8c2769f5c5573ed293ea;p=thirdparty%2FPython%2Fcpython.git gh-112925: Fix error in example of `datetime.time.fromisoformat` and add doctest marker (GH-112931) --- diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 686b37754368..3674b4bd97d3 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1799,6 +1799,8 @@ Other constructor: Examples:: + .. doctest:: + >>> from datetime import time >>> time.fromisoformat('04:23:01') datetime.time(4, 23, 1) @@ -1808,7 +1810,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)))