Files
RustPython/extra_tests/snippets/recursion.py
Rex Ledesma 4e2e0b41c6 chore: add ruff format --check (#5774)
* chore: add `ruff format --check`

* fix tests
2025-05-12 14:20:01 +09:00

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)