mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
14 lines
282 B
Python
14 lines
282 B
Python
from testutils import assert_raises
|
|
|
|
|
|
class Foo(object):
|
|
pass
|
|
|
|
|
|
Foo.__repr__ = Foo.__str__
|
|
|
|
foo = Foo()
|
|
# Since the default __str__ implementation calls __repr__ and __repr__ is
|
|
# actually __str__, str(foo) should raise a RecursionError.
|
|
assert_raises(RecursionError, str, foo)
|