mirror of
https://github.com/python/cpython.git
synced 2025-10-27 16:57:08 +00:00
Issue #9507: Named tuple repr will now automatically display the right
name in a tuple subclass.
This commit is contained in:
parent
a6b76ba52e
commit
d331ce9e66
4 changed files with 15 additions and 2 deletions
|
|
@ -605,7 +605,7 @@ Example:
|
|||
<BLANKLINE>
|
||||
def __repr__(self):
|
||||
'Return a nicely formatted representation string'
|
||||
return 'Point(x=%r, y=%r)' % self
|
||||
return self.__class__.__name__ + '(x=%r, y=%r)' % self
|
||||
<BLANKLINE>
|
||||
def _asdict(self):
|
||||
'Return a new OrderedDict which maps field names to their values'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue