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

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'dictionary': 0.07; 'assumed': 0.09; 'am,': 0.14; 'wrote:': 0.14; 'angelico': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nan': 0.16; 'subject:key': 0.16; 'subject:set': 0.16; 'header:In-Reply- To:1': 0.21; 'objects,': 0.23; 'received:209.85.210.174': 0.23; 'received:mail-iy0-f174.google.com': 0.23; 'not.': 0.26; 'message- id:@mail.gmail.com': 0.28; 'sun,': 0.30; 'it.': 0.31; 'equal': 0.31; 'to:addr:python-list': 0.33; 'chris': 0.34; 'uses': 0.36; 'received:google.com': 0.37; 'received:209.85': 0.37; 'but': 0.38; 'subject:: ': 0.38; 'received:209': 0.39; 'itself.': 0.39; 'to:addr:python.org': 0.39; '10:28': 0.84; 'albert': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=vjimGgKocqz3XFA7LVeQ2bioZ2greJhk1A8hg/f82EA=; b=xeMDB4jdmKbyowWpoN7+Fky+zDLTZw3/c1SH4IGaBaFC6uwdbu4pjbm1txXpUMQOSE p4pdy/4pvDZZR7UDXyk+2xASsdf3xjE4Wf8drfFWPixfqifEInRnkla4dyW8X2coVxDS 7Rm4yfmSnq5WfK4CG2Bh1Y1Pnbp6noA6MC16w=
DomainKey-Signature a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pD5ktSPbplxHKH7qB3rWjwTdsU9tZsT2BlbsOdxuvXtkaCPTQW/EpenM68D6VACjq+ 9WJ2uzKr8nnHV+zO/6io61t4pNnJdRqmxa6aHoKYg1zH4A2pVwCl/CzlujSch+GjSi6p DlorzeATuBXe/N0ByVqonjoBk/7DIc7DA4Va8=
MIME-Version 1.0
In-Reply-To <1306628926.168355.5.camel@localhost.localdomain>
References <4DE1881C.8000701@mrabarnett.plus.com> <1306628926.168355.5.camel@localhost.localdomain>
Date Sun, 29 May 2011 10:32:43 +1000
Subject Re: float("nan") in set or as key
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2209.1306629167.9059.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 82.94.164.166
X-Trace 1306629168 news.xs4all.nl 49179 [::ffff:82.94.164.166]:39343
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:6502

Show key headers only | 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