[Python-bugs-list] [Bug #112943] infinite recursion bug

noreply@sourceforge.net noreply@sourceforge.net
Mon, 28 Aug 2000 08:58:08 -0700


Bug #112943, was updated on 2000-Aug-28 08:40
Here is a current snapshot of the bug.

Project: Python
Category: Core
Status: Open
Resolution: None
Bug Group: None
Priority: 9
Summary: infinite recursion bug

Details: Hello!

PythonWin crashes when trying to run the following code

Hello!

PythonWin 1.5.2 (build 132) crashes (on WinNT 4.0) on the following code. 

class X:
    def __init__(self,x):
        self.val = x
    def __add__(x,y):
        return X(x.val + y.val)
    def __radd__(x,y): return y + x

if __name__ == '__main__':
    x = X(4)
    y = 3 + x


Follow-Ups:

Date: 2000-Aug-28 08:49
By: gvanrossum

Comment:
Hello!

The example causes endless recursion on __radd__. (You should have said "return x+y" there.)

Hello!

It is still a bug in 2.0b1!  Should be fixed.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=112943&group_id=5470