W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

Re: [XML-SIG] RE: Equality tests on DOM nodes

From: Fredrik Lundh <fredrik@pythonware.com>
Date: Tue, 15 Dec 1998 03:53:05 -0500 (EST)
Message-ID: <00db01be2808$f0d01250$f29b12c2@pythonware.com>
To: "John Cowan" <cowan@locke.ccil.org>, "DOM List" <www-dom@w3.org>, <xml-sig@python.org>
John Cowan wrote:
> Fred L. Drake wrote:
>> Typically,
>> two Python objects (let's take lists as an examples) are considered
>> equal if their contents are the same; equality of two objects is not
>> considered to be an unchangable characteristic.
>The trouble with that scheme is that it makes equality hard to
>reason about.  Intuitively, we expect equality to be transitive,
>(if a = b and b = c then a = c), reflexive (a = a), and symmetrical
>(if a = b then b = a).  Making equality depend on mutable properties
>defeats this: a might = b at one time, but a later check for 
>b = a might fail.

Do your bank agree with you on this one?

("hey, I know there was $1000 on this account a week ago,
and it's definitely the same account number!")

(but sure, Python provides the "is" operator if you
really want to test for object identity.  Beginners
seem to have trouble grasping that concept, though,
so I doubt it qualifies as "intuitive"...)

Cheers /F
Received on Tuesday, 15 December 1998 03:58:57 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:05 UTC