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


Groups > comp.lang.python > #74175 > unrolled thread

Re: NaN comparisons - Call For Anecdotes

Started bySkip Montanaro <skip@pobox.com>
First post2014-07-08 10:24 -0500
Last post2014-07-08 10:24 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: NaN comparisons - Call For Anecdotes Skip Montanaro <skip@pobox.com> - 2014-07-08 10:24 -0500

#74175 — Re: NaN comparisons - Call For Anecdotes

FromSkip Montanaro <skip@pobox.com>
Date2014-07-08 10:24 -0500
SubjectRe: NaN comparisons - Call For Anecdotes
Message-ID<mailman.11634.1404833099.18130.python-list@python.org>
On Tue, Jul 8, 2014 at 10:19 AM, Chris Angelico <rosuav@gmail.com> wrote:
> For hash keys, float object identity will successfully look them up:
>>>> d={}
>>>> d[float("nan")]=1
>>>> d[float("nan")]=2
>>>> x=float("nan")
>>>> d[x]=3
>>>> d[x]
> 3
>>>> d
> {nan: 1, nan: 2, nan: 3}

Neat!

S

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web