Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'underlying': 0.09; '>>>': 0.12; 'am,': 0.14; 'wrote:': 0.14; '"copyright",': 0.16; '"credits"': 0.16; '"license"': 0.16; '[gcc': 0.16; 'enigma': 0.16; 'kern': 0.16; 'nan': 0.16; 'repr()': 0.16; 'subject:key': 0.16; 'subject:set': 0.16; 'dec': 0.17; "hasn't": 0.19; 'header:In-Reply-To:1': 0.21; 'platforms.': 0.23; 'produced': 0.26; 'string': 0.26; 'import': 0.29; 'interpret': 0.29; "python's": 0.29; 'al.': 0.30; 'header:X-Complaints-To:1': 0.32; 'to:addr:python-list': 0.33; 'handling': 0.33; 'it?': 0.33; 'header:User-Agent:1': 0.35; 'complaints': 0.35; 'latter': 0.35; 'received:24': 0.35; 'received:rr.com': 0.36; 'accepted': 0.36; 'two': 0.37; 'think': 0.38; 'received:org': 0.38; 'though': 0.38; 'subject:: ': 0.38; 'attempt': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'more': 0.60; 'world': 0.63; 'our': 0.63; 'believe': 0.66; '2.7.1': 0.84; 'eco': 0.91; 'edwards': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robert Kern Subject: Re: float("nan") in set or as key Date: Thu, 02 Jun 2011 12:04:00 -0500 Organization: The Church of Last Thursday References: <94dkd3F7k4U1@mid.individual.net> <4de1e3e7$0$2195$742ec2ed@news.sonic.net> <4de22007$0$29996$c3e8da3$5496439d@news.astraweb.com> <4de2d746$0$29996$c3e8da3$5496439d@news.astraweb.com> <4de75dd5$0$29983$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: rrcs-24-227-244-203.sw.biz.rr.com User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307034253 news.xs4all.nl 49177 [::ffff:82.94.164.166]:58650 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6872 On 6/2/11 8:05 AM, Grant Edwards wrote: > Two of my perennial complaints about Python's handling of NaNs and > Infs: > > 1) They weren't handle by pickle et al. > > 2) The string representations produced by repr() and accepted by > float() weren't standardized across platforms. > > I think the latter has finally been fixed, hasn't it? And the former! Python 2.7.1 |EPD 7.0-2 (32-bit)| (r271:86832, Dec 3 2010, 15:41:32) [GCC 4.0.1 (Apple Inc. build 5488)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> inf = 1e300*1e300 >>> nan = inf / inf >>> import cPickle >>> cPickle.loads(cPickle.dumps(nan)) nan >>> cPickle.loads(cPickle.dumps(inf)) inf -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco