> This strict interpretation is violated all the time in OO programming; > consider e.g. the common overriding of object.__repr__. (In fact, even > the definition of dict.__eq__ overriding object.__eq__ would validate > it.) AFAIK a more common use of the term in OO languages is about > signatures only:
Slightly off-topic: I think what matters in reality is a difficult-to-formulate *specification* of the behavior of the operation also. I.e. not /all/ provable properties of the base implementation need to be maintained, but only those occurring in the specification of the base operation. Applications using the base then can only rely on the *specified* properties of the operations they use, and there you get substitutability. Of course, what properties are part of the specification is an ongoing discussion for many class hierarchies, in many languages (see e.g. the relationship between __eq__ and __hash__). Beyond transitivity and consistency with __hash__ (which is irrelevant here), I don't think odict.__eq__ should be restricted to behave the same as dict.__eq__. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com