On Fri, 19 Mar 2004 13:28:39 -0500 "Andrew Koenig" <ark-mlist at att.net> wrote: [..] > > Seems to me as if there are no more than TWO meanings for any given > > type of object, and that we provide two comparison operators in each > > case. So what's missing? > > Consider a slight variation on the example above: > > a = [] > b = [] > x1 = (a, b) > y1 = (a, b) > > Now: x1 and y1 are mutually substitutable; x and y are equal but not > mutually substitutable, and x, y, x1, and y1 are all distinct objects. > > So I think there are three kinds of comparison, not just two. So let's see if I can rephrase this: Objects are equivilant if they are the same type and their states are the same Objects are interchangable if they are equivilant and their states will always be the same (i.e., changes to one are always reflected in the other) or if they are equivilant and immutable. Objects are identical if they are physically the same (in the sense of 'is' currently) There is also a fourth type: Objects are equal if ob1.__eq__(ob2) returns true. -Casey
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4