Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'mrab': 0.05; "subject:' ": 0.07; 'false.': 0.09; 'objects,': 0.09; 'wrong,': 0.09; 'random': 0.14; '(there': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nan': 0.16; 'sat,': 0.16; 'wrote:': 0.18; '>>>': 0.22; '15,': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'though.': 0.31; 'maybe': 0.34; 'subject:with': 0.35; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'objects': 0.35; 'received:google.com': 0.35; 'received:209': 0.37; 'expected': 0.38; 'e.g.': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'expectations': 0.74; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=c6axY/FyPkBDrEMyL1mJY6yDbkZ9NklHEUQ5VKOISqQ=; b=jijw+yOi8yIFFdiSDQJI7Gl2hk4EZOI7tuBPztAkF9faNMvdfuhrii1lYu5y0bKvmd 6jyP+hPOc/fTC9fhei0CJ2b+hFRoWv0LgFO2yWujC1Z9e0bj2LHFu8ccumcvi2yZWE+1 Jc5bdroKIZjsDFrJYzaVQIW6mxCkwAEN6HrBEQcMEVK2yDSYt/HSQVcHOawNmMEZQ1Iu bSFHZcGl2DWB9QKGh6jjcwm5KOcmmpobxHVNWB+83XZTGzQtMpr+KogaBQSnn1b+sjcy L+vW0Bi1sifgJSI74kk858qEKtro2dEPNzmiqgVVqh1ze6SkcS93bo0uVVofNMaFAKjg GQQw== MIME-Version: 1.0 X-Received: by 10.52.155.67 with SMTP id vu3mr1114476vdb.94.1371232588790; Fri, 14 Jun 2013 10:56:28 -0700 (PDT) In-Reply-To: <51BB5797.4030705@mrabarnett.plus.com> References: <51bb4986$0$29997$c3e8da3$5496439d@news.astraweb.com> <51BB52C5.60202@gmail.com> <51BB5797.4030705@mrabarnett.plus.com> Date: Sat, 15 Jun 2013 03:56:28 +1000 Subject: Re: Eval of expr with 'or' and 'and' within From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371232596 news.xs4all.nl 15915 [2001:888:2000:d::a6]:60930 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48199 On Sat, Jun 15, 2013 at 3:49 AM, MRAB wrote: > The general rule is that an object is true-ish unless it's false-ish > (there are fewer false-ish objects than true-ish objects, e.g. zero vs > non-zero int). 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. ChrisA