Message358726
===
# python3
class Base:
def __eq__(self, other):
print("base called")
return super().__eq__(other)
class Foo(Base):
def __eq__(self, other):
print("foo called")
return NotImplemented
Foo() == Foo()
# foo called
# foo called
False
====
Base.__eq__ is not called here. Is calling of object.__eq__ special cased? |
|
Date |
User |
Action |
Args |
2019-12-20 18:40:55 | murali | set | recipients:
+ murali, brett.cannon, docs@python |
2019-12-20 18:40:55 | murali | set | messageid: <1576867255.8.0.798121189135.issue39111@roundup.psfhosted.org> |
2019-12-20 18:40:55 | murali | link | issue39111 messages |
2019-12-20 18:40:55 | murali | create | |
|