summaryrefslogtreecommitdiffstats
path: root/Lib/_pydatetime.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-10-02 14:58:43 (GMT)
committerGitHub <noreply@github.com>2023-10-02 14:58:43 (GMT)
commite5c860f9d03669f152292fb82665edfc2c01e5ec (patch)
tree4eafe6bd0875281a8252017030074911c50ba053 /Lib/_pydatetime.py
parent775fd782fca77037c3f9bca6f7c528bcef669acb (diff)
downloadcpython-e5c860f9d03669f152292fb82665edfc2c01e5ec.zip
cpython-e5c860f9d03669f152292fb82665edfc2c01e5ec.tar.gz
cpython-e5c860f9d03669f152292fb82665edfc2c01e5ec.tar.bz2
[3.12] Fix date.__repr__() docstring (GH-109422) (#109448)
Fix date.__repr__() docstring (GH-109422) (cherry picked from commit 5eec58a9e57383128ade7b527965b1efc474735b) Co-authored-by: Christopher Yeh <chrisyeh96@users.noreply.github.com>
Diffstat (limited to 'Lib/_pydatetime.py')
-rw-r--r--Lib/_pydatetime.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/_pydatetime.py b/Lib/_pydatetime.py
index a6d4339..0e34d8a 100644
--- a/Lib/_pydatetime.py
+++ b/Lib/_pydatetime.py
@@ -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__,