Re: a.index(float('nan')) fails

Discussion in 'Python' started by Cameron Simpson, Oct 26, 2012.

  1. On 25Oct2012 22:04, Terry Reedy <> wrote:
    | Containment of nan in collection is tested by is, not ==.
    | >>> nan = float('nan')
    | >>> nan2 = float('nan')
    | >>> nan2 is nan
    | False

    This argues otherwise, and for use of math.isnan() instead.

    I expect you were making the point that another NaN is distinct, but it
    didn't seem clear to me.

    Cheers,
    --
    Cameron Simpson <>

    In article , (Mcrider) writes:
    >Could one of you physicist-type cyber-riders give a lucid description/
    >explanation of what some folks loosely refer to as a 'tank-slapper'?


    An undamped oscillation of camber thrust, with positive feedback,
    applied to the front contact patch? :^)
    - Ed Green, , DoD#0111
    Cameron Simpson, Oct 26, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bd
    Replies:
    0
    Views:
    621
  2. max(NaN,0) should be NaN

    , Aug 28, 2006, in forum: C Programming
    Replies:
    61
    Views:
    1,251
    Michel Hack
    Sep 8, 2006
  3. Replies:
    6
    Views:
    1,517
    Richard Tobin
    Mar 19, 2009
  4. Carsten Fuchs
    Replies:
    45
    Views:
    1,532
    James Kanze
    Oct 8, 2009
  5. Replies:
    25
    Views:
    331
    Ethan Furman
    Oct 28, 2012
Loading...

Share This Page