From: Victor Stinner Date: Fri, 15 Sep 2023 13:29:57 +0000 (+0200) Subject: [3.11] Fix date.__repr__() docstring (#109422) (#109449) X-Git-Tag: v3.11.6~85 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43191d294c6af1d1811ae51db4a3377bf5c955dc;p=thirdparty%2FPython%2Fcpython.git [3.11] Fix date.__repr__() docstring (#109422) (#109449) Fix date.__repr__() docstring (#109422) (cherry picked from commit 5eec58a9e57383128ade7b527965b1efc474735b) Co-authored-by: Christopher Yeh --- diff --git a/Lib/datetime.py b/Lib/datetime.py index 60927de6adeb..474b4e9ae531 100644 --- a/Lib/datetime.py +++ b/Lib/datetime.py @@ -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__,