Files
RustPython/extra_tests/snippets/recursion.py
Aphek e732669224 Make it possible for rust functions to increase recursion depth (#3252)
Make it possible for rust functions to increase recursion depth
2021-10-13 08:12:12 +03:00

12 lines
280 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)