[pypy-issue] Issue #2137: Infinite recursion with __coerce__ (pypy/pypy)

Anders Kaseorg issues-reply at bitbucket.org
Sat Sep 12 22:35:39 CEST 2015

New issue 2137: Infinite recursion with __coerce__

Anders Kaseorg:

This leads to infinite recursion (`RuntimeError: maximum recursion depth exceeded`) in PyPy 2.6.0 but not CPython 2.7.10:

class C:
    def __coerce__(self, other):
        print 'coerce'
        return C(), C()
    def __add__(self, other):
        return C()

C() + C()

CPython only calls `__coerce__` once.

More information about the pypy-issue mailing list