Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d510e3

Browse files
committed
Issue #14824: Update Repr.repr_TYPE documentation to use correct name mangling implementation.
Patch by Chris Rebert.
1 parent cb0a006 commit 2d510e3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/reprlib.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ which format specific object types.
129129

130130
Formatting methods for specific types are implemented as methods with a name
131131
based on the type name. In the method name, **TYPE** is replaced by
132-
``string.join(string.split(type(obj).__name__, '_'))``. Dispatch to these
133-
methods is handled by :meth:`repr1`. Type-specific methods which need to
134-
recursively format a value should call ``self.repr1(subobj, level - 1)``.
132+
``'_'.join(type(obj).__name__.split())``. Dispatch to these methods is
133+
handled by :meth:`repr1`. Type-specific methods which need to recursively
134+
format a value should call ``self.repr1(subobj, level - 1)``.
135135

136136

137137
.. _subclassing-reprs:

0 commit comments

Comments
 (0)