Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!newsfeed1.swip.net!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!not-for-mail From: Chris Torek Newsgroups: comp.lang.python Subject: Re: float("nan") in set or as key Date: 30 May 2011 05:53:33 GMT Organization: None of the Above Lines: 19 Message-ID: References: <271acea3-c38f-4123-9038-e348fb841971@glegroupsg2000goo.googlegroups.com> <4de31635$0$29990$c3e8da3$5496439d@news.astraweb.com> NNTP-Posting-Host: pabfe886afee17ffdd596de731f192d4a07f395d214d2742c.newsdawg.com X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Originator: torek@elf.torek.net (Chris Torek) Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6628 In article I wrote, in part: > _inf = float("inf") > def isinf(x): > return x == _inf > del _inf Oops, take out the del, or otherwise fix the obvious problem, e.g., perhaps: def isinf(x): return x == isinf._inf isinf._inf = float("inf") (Of course, if something like this were adopted properly, it would all be in the base "float" type anyway.) -- In-Real-Life: Chris Torek, Wind River Systems Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603 email: gmail (figure it out) http://web.torek.net/torek/index.html