Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!feed.xsnews.nl!border-2.ams.xsnews.nl!newsfeed.xs4all.nl!newsfeed5.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.046 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'exec': 0.07; 'python': 0.08; '#define': 0.09; 'am,': 0.12; 'def': 0.14; 'cc:addr:python- list': 0.15; 'do!': 0.16; 'ha!': 0.16; 'subject:() ': 0.16; '\xc2\xa0if': 0.16; 'wed,': 0.17; 'wrote:': 0.18; 'cc:no real name:2**0': 0.21; "doesn't": 0.23; 'gcc': 0.23; 'header:In-Reply- To:1': 0.23; 'cc:2**0': 0.25; 'code': 0.25; 'code.': 0.26; 'received:209.85.220': 0.27; 'cc:addr:python.org': 0.29; 'message- id:@mail.gmail.com': 0.29; 'turned': 0.30; 'angry': 0.30; 'chris': 0.30; 'subject:?': 0.31; 'nov': 0.31; 'pm,': 0.31; 'tue,': 0.32; "can't": 0.32; 'unless': 0.35; 'clearly': 0.36; 'using': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; "there's": 0.39; 'subject:: ': 0.39; 'received:209': 0.40; 'more': 0.60; 'your': 0.61; '2011': 0.62; 'life': 0.63; 'covers': 0.64; 'policy': 0.64; 'home.': 0.75; 'face,': 0.84; 'ps.': 0.84; 'sender:addr:chris': 0.84; 'swallow.': 0.84; 'burn': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=OYgerCbJNnq21xrbZIBo5uMN4E1oml6MOBPePyaYdY4=; b=EKepQlOOIHiYX1z4Wc+AJESbyQWH3YVGlmWClj0VQrKQVXkPJljKrUyEPmkrcJ4UpZ SVVjvrt0i2JWINLaU23YMcy/OGolwz2sYwq4uCpMfJpCHuQ2rPE3u0O3Uw6eehMGqhfZ FTV/99bE2e/sdyKEw+p2qJXVHeLLnkqrfQdOk= MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: References: <436fb6a3-1075-45a6-8f93-5612d050b11a@q35g2000prh.googlegroups.com> Date: Tue, 8 Nov 2011 17:30:48 -0800 X-Google-Sender-Auth: Ygyca6F2x9SwxdOCsA1G7-1w4I8 Subject: Re: all() is slow? From: Chris Rebert To: Chris Angelico Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1320802252 news.xs4all.nl 6980 [2001:888:2000:d::a6]:41337 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15491 On Tue, Nov 8, 2011 at 5:19 PM, Chris Angelico wrote: > On Wed, Nov 9, 2011 at 11:44 AM, Devin Jeanpierre > wrote: >> Clearly what we need is a modern hygienic macro system to avoid this exe= c mess! >> >> defmacro defall(name, cond): >> =C2=A0 =C2=A0def name(lst): >> =C2=A0 =C2=A0 =C2=A0 =C2=A0for a in lst: >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if not cond: >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return False >> =C2=A0 =C2=A0 =C2=A0 =C2=A0return True > > #define defall(name,cond) def name(lst): \ > =C2=A0 =C2=A0for a in lst: \ > =C2=A0 =C2=A0 =C2=A0 =C2=A0if not cond: return False \ > =C2=A0 =C2=A0return True > > gcc -E myprog.pyi -o myprog.py > > There's no code you can't make more opaque using the C preprocessor. > > Python doesn't have inline functions? Ha! In your FACE, evil Python > development cabal! You can't tell ME what I can't do! > > ChrisA > PS. Don't try this at home. We have years of experience with bad code. > Don't write code like this unless you have a life insurance policy > that covers angry mobs. Burn him! Witch! Witch! Burn him! His code turned me into a newt! -- Sent nailed to a coconut carried by swallow.