This commit is contained in:
Antoine Pitrou 2011-07-15 21:19:27 +02:00
commit 91fe8157fd
3 changed files with 12 additions and 1 deletions

View file

@ -4247,6 +4247,14 @@ order (MRO) for bases """
with self.assertRaises(TypeError):
str.__add__(fake_str, "abc")
def test_repr_as_str(self):
# Issue #11603: crash or infinite loop when rebinding __str__ as
# __repr__.
class Foo:
pass
Foo.__repr__ = Foo.__str__
foo = Foo()
str(foo)
class DictProxyTests(unittest.TestCase):
def setUp(self):