corse in quanto segue:a == b è falso, ma id (a) == id (b) è vero?
>>> class A:
... def __str__(self):
... return "some A()"
...
>>> class B(A):
... def __str__(self):
... return "some B()"
...
>>> print A()
some A()
>>> print B()
some B()
>>> A.__str__ == B.__str__
False # seems reasonable, since each method is an object
>>> id(A.__str__)==id(B.__str__)
True # what?!
cosa sta succedendo qui?
Nota: questa risposta funziona solo per Python 2. – BenC