From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 23 Dec 2023 10:50:19 +0000 (+0100) Subject: [3.11] gh-112925: Fix error in example of `datetime.time.fromisoformat` and add docte... X-Git-Tag: v3.11.8~233 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bd134d15f48dc5e284f13f1545548cabf50c792;p=thirdparty%2FPython%2Fcpython.git [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> --- diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 5ffaae9414de..28a366cb7501 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)))