Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!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.070 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; '*not*': 0.05; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'partly': 0.16; 'subject:() ': 0.16; 'wrote:': 0.18; 'received:209.85.210.174': 0.18; 'received:mail- iy0-f174.google.com': 0.18; 'maybe': 0.21; 'header:In-Reply-To:1': 0.23; 'code': 0.25; 'project,': 0.27; 'message- id:@mail.gmail.com': 0.29; 'do.': 0.30; "it'd": 0.30; 'really,': 0.30; 'chris': 0.30; 'subject:?': 0.31; 'nov': 0.31; 'pm,': 0.31; 'anyone': 0.31; 'tue,': 0.32; 'to:addr:python-list': 0.32; 'actually': 0.33; 'normally': 0.34; 'something': 0.36; 'but': 0.37; 'received:google.com': 0.38; 'put': 0.38; 'received:209.85': 0.38; "it's": 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'getting': 0.40; 'received:209': 0.40; '2011': 0.62; 'our': 0.63; 'benefit': 0.66; 'making': 0.67; 'saw': 0.67; 'crash': 0.67; 'production': 0.70 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=fjyZPS1LxrT7xgrXHX/BJ+geJEyd+t1CU4//zq/Rz0A=; b=eKFULvVoNQn/gpBwxcUbQUu6h2ZNNl/H3IX0MH/dhKkTY8Z9GtmTp3vLbJu7xjd5Cr XnQJ0tm+TN4BGzvyvVohebGKyw1sdovsfnlmbnfMBJwxQTyUptRAYWzvdW8cDcSC6ELp ROi/FH5q+ThOZR/L+kuvaUH995W/jEWDTvbhg= MIME-Version: 1.0 In-Reply-To: References: <436fb6a3-1075-45a6-8f93-5612d050b11a@q35g2000prh.googlegroups.com> Date: Tue, 8 Nov 2011 23:14:09 +1100 Subject: Re: all() is slow? 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.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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1320754452 news.xs4all.nl 6920 [2001:888:2000:d::a6]:49506 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15465 On Tue, Nov 8, 2011 at 11:09 PM, Henrik Faber wrote: > On 07.11.2011 23:06, Chris Angelico wrote: >> So really, it's not "all() is slow" but "function calls are slow". >> Maybe it'd be worthwhile making an all-factory: > > PLEASE say you're joking. If I saw code like that on any of our project, > this would definitely qualify for a DailyWTF. For the benefit of anyone who was actually in doubt: YES, I was joking. Do *not* put code like this into any production project. But it's still fun to write bad code once in a while. It's like Mythbusters getting to crash cars. Fun partly _because_ it's something you normally don't want to do. ChrisA