Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'true,': 0.05; 'testing,': 0.09; 'cc:addr:python-list': 0.11; 'suggest': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'stats': 0.16; 'tighter': 0.16; 'true:': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'fairly': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'this:': 0.26; 'header:In- Reply-To:1': 0.27; 'specifically': 0.29; 'testing': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; 'usually': 0.31; 'equality': 0.31; 'anyone': 0.31; 'checking': 0.33; 'there,': 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'done': 0.36; 'doing': 0.36; 'should': 0.36; 'even': 0.60; 'above,': 0.60; 'mar': 0.68; 'truth': 0.81; 'to:none': 0.92; 'hill': 0.95 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:cc :content-type; bh=JWIZSsiS93WJbi8OZrmZWSRORle0KpWvGGWgOsybSKw=; b=aLBIEe1MtvBuZUSU5SRSDQaRO6vPrJyTwQa+BxQaa+cLcYORUsm12dkthaQVnO7RqS gLcE0/QywOdxO7BSjw7sE6Kv+TmN9CO3Pb+fwlUwv52P/T6VzD9bnO8V3OKZI0+9bjlF jf87cl0xAY7YEzQsTfP+KGDq/aXX92/Ju1vXN37HANWEKV65kgJ3cdY/UON2qv+7e3QO xGfxNy7s6T1bKLvctUvA49FWZuwoZuy0DqHf8FKe2ctOW25yBX9tqJpgP/Gz3Pnwdi+t VoIOSe4s8pgvxocPeRj3GRpVH03tOz75FIdinTZvRbDHJRI/JJFjzCH3fWXDHtb2gzIO 7iMA== MIME-Version: 1.0 X-Received: by 10.68.248.7 with SMTP id yi7mr65648pbc.31.1393946757467; Tue, 04 Mar 2014 07:25:57 -0800 (PST) In-Reply-To: References: <53144e8d$0$2149$426a74cc@news.free.fr> <1d1dfa1b-b715-4d8f-9c12-f0d3dc1a22c9@googlegroups.com> <85ppm3httu.fsf@benfinney.id.au> <20140303155112.46e34ff8@bigbox.christie.dr> <87siqy7whs.fsf@elektro.pacujo.net> <53155c15$0$2923$c3e8da3$76491128@news.astraweb.com> Date: Wed, 5 Mar 2014 02:25:57 +1100 Subject: Re: Reference From: Chris Angelico Cc: "python-list (General)" Content-Type: text/plain; charset=UTF-8 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393946767 news.xs4all.nl 2936 [2001:888:2000:d::a6]:58271 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67692 On Wed, Mar 5, 2014 at 2:19 AM, Jerry Hill wrote: > Out of curiosity, do you think we should be doing truth checking with > 'is'? True and False are singletons, and it seems to me that the > justification for idenity versus equality should be just as strong > there, but I don't think I've ever seen anyone even suggest that. Normal truth testing is done like this: if cond: This isn't truth testing, this is checking the identity of what's in cond: if cond is True: And that's specifically testing for something much tighter than truthiness. As you can see from my stats above, that's actually fairly rare. Usually you'd just accept that True, 1, "yes", [1,2,3], and 1.2345 are all equally true. ChrisA