1

I ran across a strange phenonemon with IronPython (2.7.5). Please take a look at the following example code:

class X(object):        
    def __eq__(self, other):
        print "__eq__"
        return False

    def foo(self):
        return 1

a = X()

print a.foo == a.foo

When run with IronPython the output is:

__eq__
False

I don't understand why the equality operator overload of class X is used (a.foo has type instancemethod, not X).

When using CPython the output is

True

I guess this is a bug in IronPython. Does anyone agree?

Krid
  • 95
  • 1
  • 11
  • For me it looks like a bug, `IronPython` should behave like `CPython`. Would you like to open an issue on `GitHub`? If you don't have any account, i would do this for you. Please let me know. – BendEg Jan 06 '16 at 07:21
  • I don't have a GitHub account, sorry. I would appreciate if you could report this issue for me. Thanks! – Krid Jan 07 '16 at 07:36
  • ok, i reported the bug for you: https://github.com/IronLanguages/main/issues/1268 – BendEg Jan 07 '16 at 08:44

0 Answers0