]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-112925: Fix error in example of `datetime.time.fromisoformat` and add docte...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 23 Dec 2023 10:50:19 +0000 (11:50 +0100)
committerGitHub <noreply@github.com>
Sat, 23 Dec 2023 10:50:19 +0000 (10:50 +0000)
(cherry picked from commit bdc8d667ab545ccec0bf8c2769f5c5573ed293ea)

Co-authored-by: F-park <52167622+F-park@users.noreply.github.com>
Doc/library/datetime.rst

index 5ffaae9414deabf85ccf8b244831690aa11fc755..28a366cb7501f86f100ba1f2287bd1ec5d34750c 100644 (file)
@@ -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)))