Skip to content

Commit 43191d2

Browse files
vstinnerchrisyeh96
andauthored
[3.11] Fix date.__repr__() docstring (#109422) (#109449)
Fix date.__repr__() docstring (#109422) (cherry picked from commit 5eec58a) Co-authored-by: Christopher Yeh <[email protected]>
1 parent 5a25505 commit 43191d2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Lib/datetime.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,13 +1002,9 @@ def fromisocalendar(cls, year, week, day):
10021002
def __repr__(self):
10031003
"""Convert to formal string, for repr().
10041004
1005-
>>> dt = datetime(2010, 1, 1)
1006-
>>> repr(dt)
1007-
'datetime.datetime(2010, 1, 1, 0, 0)'
1008-
1009-
>>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)
1010-
>>> repr(dt)
1011-
'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'
1005+
>>> d = date(2010, 1, 1)
1006+
>>> repr(d)
1007+
'datetime.date(2010, 1, 1)'
10121008
"""
10131009
return "%s.%s(%d, %d, %d)" % (self.__class__.__module__,
10141010
self.__class__.__qualname__,

0 commit comments

Comments
 (0)