From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 23 Dec 2023 10:50:00 +0000 (+0100) Subject: [3.12] gh-112925: Fix error in example of `datetime.time.fromisoformat` and add docte... X-Git-Tag: v3.12.2~275 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fee2bc15f9a22016dce5d8248caf320cfb48e9b6;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-112925: Fix error in example of `datetime.time.fromisoformat` and add doctest marker (GH-112931) (GH-113427) (cherry picked from commit bdc8d667ab545ccec0bf8c2769f5c5573ed293ea) Co-authored-by: F-park <52167622+F-park@users.noreply.github.com> --- diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 47077d5b5580..f7f839fa4ff5 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1793,6 +1793,8 @@ Other constructor: Examples:: + .. doctest:: + >>> from datetime import time >>> time.fromisoformat('04:23:01') datetime.time(4, 23, 1) @@ -1802,7 +1804,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)))