New submission from Wummel: Hi,
the attached code in t.py fails to run: class C (object): def __ror__ (self, other): return 42 print C() | C() $ python t.py Traceback (most recent call last): File "t.py", line 5, in ? print C() | C() TypeError: unsupported operand type(s) for |: 'C' and 'C' If I use old style classes (ie. "class C:" instead of "class C(object):"), the code runs fine. I suspect that the method lookup for special operator methods is different in new style classes, but why? This might also be related to issue #643841 but I am not sure. ---------- components: Interpreter Core files: t.py messages: 62361 nosy: calvin severity: normal status: open title: New style classes __ror__() operator overloading problem type: behavior versions: Python 2.4, Python 2.5 Added file: http://bugs.python.org/file9425/t.py __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2102> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com