[3.12] Fix date.__repr__() docstring (GH-109422) (#109448)

Fix date.__repr__() docstring (GH-109422)
(cherry picked from commit 5eec58a9e5)

Co-authored-by: Christopher Yeh <chrisyeh96@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2023-10-02 07:58:43 -07:00 committed by GitHub
parent 775fd782fc
commit e5c860f9d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1015,13 +1015,9 @@ class date:
def __repr__(self): def __repr__(self):
"""Convert to formal string, for repr(). """Convert to formal string, for repr().
>>> dt = datetime(2010, 1, 1) >>> d = date(2010, 1, 1)
>>> repr(dt) >>> repr(d)
'datetime.datetime(2010, 1, 1, 0, 0)' 'datetime.date(2010, 1, 1)'
>>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)
>>> repr(dt)
'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'
""" """
return "%s.%s(%d, %d, %d)" % (_get_class_module(self), return "%s.%s(%d, %d, %d)" % (_get_class_module(self),
self.__class__.__qualname__, self.__class__.__qualname__,