Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'parser': 0.07; 'false,': 0.09; 'pep': 0.09; 'url:github': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'translation': 0.12; 'itself.': 0.14; '"is': 0.16; 'alexander': 0.16; 'ast': 0.16; 'false:': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'none.': 0.16; 'url:py': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'module': 0.19; 'not,': 0.20; 'cc:addr:python.org': 0.22; 'tells': 0.24; 'cc:2**0': 0.24; 'compare': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'yes.': 0.31; 'run': 0.32; 'quite': 0.32; "i'd": 0.34; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'that,': 0.38; 'easy': 0.60; 'more': 0.64; 'within': 0.65; 'mar': 0.68; 'truth': 0.81; 'url:master': 0.84; 'to:none': 0.92 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=FrC4buL91fkcEk6p1xXFpIDgj63RixvanqJIXYOTzq8=; b=F3M7SNT3WWuKCDbCyrwkDVHfpwZ54WUWhAF6RUG/vD9jBSiSIEvtvwC2J1V8MsCBDM QKhEe6je+2TMSub3Bc4aEJla8txWVCHy9V79yLYkSwsMyvfHM3J283tiYV4A+xT1qIwp KTFKRt0lN0pijR0O12iy5m0EgYQqW7o/qKWcdC9gYjjS7msZAQjBA/vEEgyUmtHs9AD2 Br24NKYvtcPALnXv2uN65R5BtsLeuWjBdb4lWCRpUv6JNXPLthYKXHOLFoCeA9mX0h+8 1DdeExTdG8SOjPbTYP5eNxgsInFzEoN6bhad6Sl7jGNMe9TWHn4tTA1z3opmPGoB3K0k XG5A== MIME-Version: 1.0 X-Received: by 10.68.201.10 with SMTP id jw10mr2249142pbc.25.1393970503483; Tue, 04 Mar 2014 14:01:43 -0800 (PST) In-Reply-To: <53164b54$0$6663$9b4e6d93@newsspool2.arcor-online.net> References: <53144e8d$0$2149$426a74cc@news.free.fr> <5315cd4b$0$6670$9b4e6d93@newsspool2.arcor-online.net> <53164b54$0$6663$9b4e6d93@newsspool2.arcor-online.net> Date: Wed, 5 Mar 2014 09:01:43 +1100 Subject: Re: Reference From: Chris Angelico Cc: "python-list@python.org" 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393970506 news.xs4all.nl 2860 [2001:888:2000:d::a6]:34725 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67736 On Wed, Mar 5, 2014 at 8:53 AM, Alexander Blinne wrote: > Am 04.03.2014 15:06, schrieb Chris Angelico: >> https://github.com/Rosuav/ExceptExpr/blob/master/find_except_expr.py > > I have always found it quite nice that the python parser is so easy to > use from within python itself. Yes. Until I put together the original version of that, to search for PEP 463 translation candidates, I'd never used the ast module other than for literal_eval. It's marvelously powerful. >> Run across the Python stdlib, that tells me there are 4040 uses of >> is/is not, of which 16 compare against False, 18 against True (see? >> Python has a bias for truth above falsehood!), and 3386 against None. > > I think i will have to rephrase my "is False" condition to make it more > truthy :) if x is False: --> if not x: ChrisA