[XML-SIG] DOM Nodes: Identity test

Paul Prescod paul@prescod.net
Wed, 24 Mar 1999 10:22:13 -0600


"Andrew M. Kuchling" wrote:
> 
>         I've been wondering about that myself.  We don't want to
> overload __cmp__ to do this, because Python comparisions are usually
> done by value; 

We could agree that the only by-value check that makes sense is the
identity check. This is the same as saying that the location of a node in
the tree is part of its value. 

I note that the default "==" behaviour for new Python classes is to use
the identity so there are probably dozens of Python classes in the
standard distribution with this behaviour.

>>> class A:
...    pass
...
>>> A()==A()
0

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

"Perpetually obsolescing and thus losing all data and programs every 10
years (the current pattern) is no way to run an information economy or
a civilization." - Stewart Brand, founder of the Whole Earth Catalog
http://www.wired.com/news/news/culture/story/10124.html