]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] Fix date.__repr__() docstring (#109422) (#109449)
authorVictor Stinner <vstinner@python.org>
Fri, 15 Sep 2023 13:29:57 +0000 (15:29 +0200)
committerGitHub <noreply@github.com>
Fri, 15 Sep 2023 13:29:57 +0000 (13:29 +0000)
Fix date.__repr__() docstring (#109422)

(cherry picked from commit 5eec58a9e57383128ade7b527965b1efc474735b)

Co-authored-by: Christopher Yeh <chrisyeh96@users.noreply.github.com>
Lib/datetime.py

index 60927de6adeb1aef415db51af8694055ad80fa32..474b4e9ae5312c422aac5e95cd83b62e0d0abeec 100644 (file)
@@ -1002,13 +1002,9 @@ class date:
     def __repr__(self):
         """Convert to formal string, for repr().
 
-        >>> dt = datetime(2010, 1, 1)
-        >>> repr(dt)
-        'datetime.datetime(2010, 1, 1, 0, 0)'
-
-        >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)
-        >>> repr(dt)
-        'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'
+        >>> d = date(2010, 1, 1)
+        >>> repr(d)
+        'datetime.date(2010, 1, 1)'
         """
         return "%s.%s(%d, %d, %d)" % (self.__class__.__module__,
                                       self.__class__.__qualname__,