Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74175 > unrolled thread
| Started by | Skip Montanaro <skip@pobox.com> |
|---|---|
| First post | 2014-07-08 10:24 -0500 |
| Last post | 2014-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.
Re: NaN comparisons - Call For Anecdotes Skip Montanaro <skip@pobox.com> - 2014-07-08 10:24 -0500
| From | Skip Montanaro <skip@pobox.com> |
|---|---|
| Date | 2014-07-08 10:24 -0500 |
| Subject | Re: 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
Back to top | Article view | comp.lang.python
csiph-web