Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6502

Re: float("nan") in set or as key

References <4DE1881C.8000701@mrabarnett.plus.com> <1306628926.168355.5.camel@localhost.localdomain>
Date 2011-05-29 10:32 +1000
Subject Re: float("nan") in set or as key
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2209.1306629167.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, May 29, 2011 at 10:28 AM, Albert Hopkins <marduk@letterboxes.org> wrote:
> This is the same nan, so it is equal to itself.
>

Actually, they're not. But it's possible the dictionary uses an 'is'
check to save computation, and if one thing 'is' another, it is
assumed to equal it. That's true of most well-behaved objects, but nan
is not well-behaved :)

Chris Angelico

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: float("nan") in set or as key Chris Angelico <rosuav@gmail.com> - 2011-05-29 10:32 +1000
  Re: float("nan") in set or as key Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-29 08:51 +0000

csiph-web