mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-36793: Remove unneeded __str__ definitions. (GH-13081)
Classes that define __str__ the same as __repr__ can just inherit it from object.
This commit is contained in:
parent
9646630895
commit
96aeaec647
18 changed files with 25 additions and 33 deletions
|
@ -2300,7 +2300,7 @@ class DocTestCase(unittest.TestCase):
|
|||
name = self._dt_test.name.split('.')
|
||||
return "%s (%s)" % (name[-1], '.'.join(name[:-1]))
|
||||
|
||||
__str__ = __repr__
|
||||
__str__ = object.__str__
|
||||
|
||||
def shortDescription(self):
|
||||
return "Doctest: " + self._dt_test.name
|
||||
|
@ -2399,7 +2399,6 @@ class DocFileCase(DocTestCase):
|
|||
|
||||
def __repr__(self):
|
||||
return self._dt_test.filename
|
||||
__str__ = __repr__
|
||||
|
||||
def format_failure(self, err):
|
||||
return ('Failed doctest test for %s\n File "%s", line 0\n\n%s'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue