On Wed, Sep 1, 2010 at 12:50 PM, David Gowers <[email protected]> wrote:
>> efficiently? Or does defining a __eq__ method override any use of
>> hashes?
>
> I should discard the __eq__ method and just define a __hash__ method.
> Thanks, TMC :)
Oh, btw, __eq__ and __hash__ are for different things, if that is what
you meant. If you look at the revision history,
you can see I used self.__hash__ inside the __eq__ method.

(I've just swapped that implementation out with a more optimized
'perfect' comparison -- see latest commit on nohrio git master.
quick_eq can be patched in if the speed difference effects you
(probably if your document contains lots of large strings/ binary
blobs, or if you have ludicrous numbers of nodes.))

>
>> I'm not sure it's needed, since AFAIK the only way that a node would
>> actually change type to something textually equivalent is through
>> being converted to XML and back.
mm..
I think I'll leave this out for now. If it turns out someone actually
definitely needs it, I'll implement it.
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to