Closed ghost closed 9 years ago
If you're asking why Pyston behaves differently from CPython, the answer is almost always "bug or unimplemented feature" :)
Right now Pyston's support for "old-style classes" is pretty lacking. If you make it a "new-style class" (by deriving it from object
), it works:
class A(object):
def __eq__(self, other):
return True
a0 = A()
a1 = A()
print a0 == a1
But as you point out we need to make it work for old-style classes too. For this we need to implement the __eq__
method on instance
objects (src/runtime/classobj.cpp
).
Ok I opened #254 to track this and the other missing ones, thanks for bringing it up!
If I have the following code:
Pyston will print
False
while CPython will printTrue
, why?