comparing nan "number"

John J. Lee jjl at pobox.com
Wed Dec 3 19:16:14 CET 2003


Michael Hudson <mwh at python.net> writes:

> jjl at pobox.com (John J. Lee) writes:
> 
> > Alexander Schmolck <a.schmolck at gmx.net> writes:
> > [...]
> > > possibly be `False` and {x:"some value}[x] might well raise an exception if
> > > `x` is a nan (or indeed one of infinitely many Numeric arrays with
> > [...]
> > 
> > Don't you mean SomeMapping((x, "some value"))[x]?  A dict lookup
> > doesn't use __eq__.
> 
> Huh?  Yes it does (*after* __hash__, of course, but...).

Oh, collisions, right?


John




More information about the Python-list mailing list