On Mon, Apr 28, 2008 at 10:24:01AM -0700, Christopher Barker wrote:
> Sean Gillies wrote:
> > How many of you use
> >
> > 1) a == b
> >
> > to test for topological equality instead of using
> >
> > 2) a.equals(b)
>
> > 1 is stronger than, but implies 2. 2 does not imply 1.
>
> So what is the difference that you propose? What other definitions of
> equality do you want to support?
As I understand it, a == b means that a is the same object as b
(i.e. lives at the same address in memory) whereas a.equals(b)
means that a and b have the same value but may not be the same
object.
So it is quite possible to have (generic pseudocode),
a = Point(0,0)
b = Point(0,0)
c = a
a == b -> false
a == c -> true
a.equals(b) -> true
a.equals(c) -> true
Cheers,
-w
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community