]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Fix date.__repr__() docstring (GH-109422) (#109448)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 2 Oct 2023 14:58:43 +0000 (07:58 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Oct 2023 14:58:43 +0000 (16:58 +0200)
Fix date.__repr__() docstring (GH-109422)
(cherry picked from commit 5eec58a9e57383128ade7b527965b1efc474735b)

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

index a6d43399f9e7037ed5bf38579219f3313a5b3a16..0e34d8aacf531daaf79ebf598da914081f7f188e 100644 (file)
@@ -1015,13 +1015,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)" % (_get_class_module(self),
                                       self.__class__.__qualname__,