mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix date.__repr__() docstring (#109422)
This commit is contained in:
parent
b434dd7e36
commit
5eec58a9e5
1 changed files with 3 additions and 7 deletions
|
@ -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__,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue