]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-112925: Fix error in example of `datetime.time.fromisoformat` and add doctest...
authorF-park <52167622+F-park@users.noreply.github.com>
Sat, 23 Dec 2023 10:44:27 +0000 (18:44 +0800)
committerGitHub <noreply@github.com>
Sat, 23 Dec 2023 10:44:27 +0000 (12:44 +0200)
Doc/library/datetime.rst

index 686b37754368c128de9a4a1877df41b3c48413bc..3674b4bd97d39db8069f18f4826c26442b179f5d 100644 (file)
@@ -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)))