diff options
author | Raymond Hettinger <python@rcn.com> | 2010-08-08 01:13:42 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-08-08 01:13:42 (GMT) |
commit | d331ce9e6686f180373853fef5d819f36d331d44 (patch) | |
tree | 56c8cc04e49237168a85545285f9cbcacf02ad55 /Doc/library/collections.rst | |
parent | a6b76ba52e00c47eafba57362184f7779330154a (diff) | |
download | cpython-d331ce9e6686f180373853fef5d819f36d331d44.zip cpython-d331ce9e6686f180373853fef5d819f36d331d44.tar.gz cpython-d331ce9e6686f180373853fef5d819f36d331d44.tar.bz2 |
Issue #9507: Named tuple repr will now automatically display the right
name in a tuple subclass.
Diffstat (limited to 'Doc/library/collections.rst')
-rw-r--r-- | Doc/library/collections.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 741c7a0..66d373d 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -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' |