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


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

Re: Is nan in (nan,) correct?

Started byTerry Reedy <tjreedy@udel.edu>
First post2015-03-05 20:20 -0500
Last post2015-03-05 20:20 -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: Is nan in (nan,) correct? Terry Reedy <tjreedy@udel.edu> - 2015-03-05 20:20 -0500

#86970 — Re: Is nan in (nan,) correct?

FromTerry Reedy <tjreedy@udel.edu>
Date2015-03-05 20:20 -0500
SubjectRe: Is nan in (nan,) correct?
Message-ID<mailman.74.1425604850.21433.python-list@python.org>
Nothing about nans is 'correct'.  They are a CS invention

On 3/5/2015 5:26 PM, random832@fastmail.us wrote:
> It's been brought up on Stack Overflow that the "in" operator (on
> tuples, and by my testing on dict and list, as well as dict lookup) uses
> object identity as a shortcut, and returns true immediately if the
> object being tested *is* an element of the container. However, the
> contains operation does not specify whether object identity or equality
> is to be used. In effect, the built-in container types use a hybrid
> test: "a is b or a == b".
>
> My question is, is this a *correct* implementation of the operator,

The current implementation of 'in' is 'correct' in that it reflects the 
intentions of GvR and other core developers.

-- 
Terry Jan Reedy

[toc] | [standalone]


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


csiph-web