Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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; 'float': 0.07; "subject:' ": 0.07; 'correct,': 0.09; 'false.': 0.09; 'wrong,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'random': 0.14; "wouldn't": 0.14; 'distinct': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'nan': 0.16; 'nans': 0.16; 'opposite': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'simpson': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'python?': 0.22; 'cc:addr:python.org': 0.22; 'header:User- Agent:1': 0.23; 'cheers,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; '(although': 0.31; '+0100,': 0.31; "d'aprano": 0.31; 'gather': 0.31; 'steven': 0.31; 'though.': 0.31; 'everyone': 0.33; 'not.': 0.33; 'maybe': 0.34; 'subject:with': 0.35; 'there': 0.35; 'received:com.au': 0.36; 'right?': 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'expected': 0.38; 'received:211': 0.38; 'expect': 0.39; 'even': 0.60; 'content-disposition:inline': 0.62; 'telling': 0.64; 'more': 0.64; 'taking': 0.65; 'direct': 0.67; 'nobody': 0.68; 'expectations': 0.74; 'account!': 0.84; 'calculations': 0.84; 'quicker': 0.84; '2013': 0.98 Date: Sat, 15 Jun 2013 12:03:08 +1000 From: Cameron Simpson To: "Steven D'Aprano" Subject: Re: Eval of expr with 'or' and 'and' within MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51bbc49f$0$29997$c3e8da3$5496439d@news.astraweb.com> User-Agent: Mutt/1.5.21 (2010-09-15) References: <51bbc49f$0$29997$c3e8da3$5496439d@news.astraweb.com> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Q6eKePKa c=1 sm=1 a=wom5GMh1gUkA:10 a=FBuLjTwyfbYA:10 a=kj9zAlcOel0A:10 a=vrnE16BAAAAA:8 a=ZtCCktOnAAAA:8 a=oXw8JkBlnBUA:10 a=kZ7UWmmPAAAA:8 a=O1bqdAXlpaznYxg6n7gA:9 a=CjuIK1q_8ugA:10 a=pyH5b1fOeEsA:10 a=ChdAjXE5lkUvdteQbhpnkQ==:117 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371261819 news.xs4all.nl 15994 [2001:888:2000:d::a6]:45749 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48242 On 15Jun2013 01:34, Steven D'Aprano wrote: | On Sat, 15 Jun 2013 00:09:31 +0100, Nobody wrote: | | > On Sat, 15 Jun 2013 03:56:28 +1000, Chris Angelico wrote: | >> With a few random oddities: | >>>>> bool(float("nan")) | >> True | >> I somehow expected NaN to be false. Maybe that's just my expectations | >> that are wrong, though. | > | > In general, you should expect the behaviour of NaN to be the opposite of | > what you expect. | | ... even taking that into account! *wink* | | Everyone is aware that there is more than one NAN, right? I was not. Interesting. | If my | calculations are correct, there are 9007199254740992 distinct float NANs | in Python (although there is no direct way of distinguishing them). Wouldn't id() do it? At least in terms of telling them apart? I gather they're not inspectable in Python? Cheers, -- Cameron Simpson 2 strokes are quicker than 4.