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


Groups > comp.lang.python > #6554

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

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!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.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'mrab': 0.05; 'confuse': 0.09; 'am,': 0.14; 'received:209.85.214.174': 0.14; 'received :mail-iw0-f174.google.com': 0.14; 'wrote:': 0.14; 'angelico': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nan': 0.16; 'sense...': 0.16; 'subject:key': 0.16; 'subject:set': 0.16; "wouldn't": 0.17; 'mon,': 0.17; 'header:In-Reply-To:1': 0.21; 'away.': 0.23; "doesn't": 0.25; "i'm": 0.27; 'message- id:@mail.gmail.com': 0.28; 'received:209.85.214': 0.28; 'checking': 0.29; 'equal': 0.31; 'to:addr:python-list': 0.33; 'greatly': 0.33; 'chris': 0.34; 'thinking': 0.34; 'there': 0.35; 'itself,': 0.35; 'received:google.com': 0.37; 'received:209.85': 0.37; 'could': 0.38; 'anything': 0.38; 'though': 0.38; 'subject:: ': 0.38; 'received:209': 0.39; 'sets': 0.39; 'to:addr:python.org': 0.39; 'making': 0.67; '30,': 0.84
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=gnMpN7q71C3UiN4npx6DnHkqK6HIkchNffY2VTTwMDY=; b=joEeWg9iAu3pJGNuhjtgCksS2sffgFjgS2lt1Dyn9Y48OY+TppH0nfJuEcwE19s1w6 iMzlArMMNIJgoFN11v51I+0mKex02mih7iOUaozJE/aH4qgah97dUlX6xbQyoKJe1vkb 0tYTPqE9BE0jAtkd7ToQtin/XGcQ6PCdZArns=
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=G/qD34NKGgmmZrMdUSoFGslER5N2+ZykHxpSFakfZH7OKZeYjxMwkttbZ/gqJkebPs TVf537XN2sevd/AbfSD9ykCx+2vpDUGgDbcVmP3ew4Xp7OfTN3tw+L7LvJa1S6QrbuuM K2dT90QlXaoCFhXf2NISB3GPKyYKz5OHgWjIU=
MIME-Version 1.0
In-Reply-To <4DE285E8.4080801@mrabarnett.plus.com>
References <4DE1881C.8000701@mrabarnett.plus.com> <mailman.2207.1306628936.9059.python-list@python.org> <irsarj$2b9$1@reader1.panix.com> <mailman.2215.1306657864.9059.python-list@python.org> <irtlu8$qk3$1@reader1.panix.com> <4DE285E8.4080801@mrabarnett.plus.com>
Date Mon, 30 May 2011 03:50:15 +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.2228.1306691418.9059.python-list@python.org> (permalink)
Lines 11
NNTP-Posting-Host 82.94.164.166
X-Trace 1306691418 news.xs4all.nl 49180 [::ffff:82.94.164.166]:51680
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:6554

Show key headers only | View raw


On Mon, May 30, 2011 at 3:44 AM, MRAB <python@mrabarnett.plus.com> wrote:
> Would there be any advantage to making NaN a singleton? I'm thinking
> that it could make checking for it cheaper in the implementation of
> sets and dicts. Or making NaN unhashable?

Doesn't matter. It still wouldn't be equal to itself, even though it
'is' itself, which will greatly confuse anything that optimizes that
away. Numbers are well-behaved; NaN is not a number; NaN is not
well-behaved. It makes sense... in a way.

Chris Angelico

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


Thread

Re: float("nan") in set or as key Albert Hopkins <marduk@letterboxes.org> - 2011-05-28 20:28 -0400
  Re: float("nan") in set or as key Erik Max Francis <max@alcyone.com> - 2011-05-28 17:44 -0700
  Re: float("nan") in set or as key Grant Edwards <invalid@invalid.invalid> - 2011-05-29 02:25 +0000
    Re: float("nan") in set or as key Wolfgang Rohdewald <wolfgang@rohdewald.de> - 2011-05-29 10:27 +0200
      Re: float("nan") in set or as key Grant Edwards <invalid@invalid.invalid> - 2011-05-29 14:41 +0000
        Re: float("nan") in set or as key MRAB <python@mrabarnett.plus.com> - 2011-05-29 18:44 +0100
          Re: float("nan") in set or as key Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-29 18:27 +0000
        Re: float("nan") in set or as key Chris Angelico <rosuav@gmail.com> - 2011-05-30 03:50 +1000
        Re: float("nan") in set or as key Christian Heimes <lists@cheimes.de> - 2011-05-29 20:05 +0200
          Re: float("nan") in set or as key Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-29 18:46 +0000
        Re: float("nan") in set or as key Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-05-29 20:36 -0700

csiph-web