Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.news.ox.ac.uk!news.ox.ac.uk!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.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.052 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'works.': 0.09; 'cc:addr :python-list': 0.11; '11:59': 0.16; 'away!': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:bit': 0.16; 'wrote:': 0.18; 'examples': 0.20; 'fit': 0.20; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'van': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'that.': 0.31; 'really,': 0.31; 'fri,': 0.33; 'trouble': 0.34; 'but': 0.35; 'received:google.com': 0.35; '14,': 0.36; "didn't": 0.36; 'skip:a 30': 0.61; 'skip:t 30': 0.61; 'save': 0.62; 'saw': 0.77; '.....': 0.78; 'ware': 0.91; '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=aBu2JsBv1ilOE9aRsep8zCbul/SSt7SATpTuV4shNko=; b=NgGZTW/l1OX+pL9e3iz4FKQocq2+Zd0unQZgKryu6EEuAXHTM4fPzNc45YmxFRiw9O 4W1vTjRVkzFpOJ4m0PR1lMeoZ07zK1rgxMLqZMgogT1LFqNyg7ij6SAy1dmT88d6vOpA kqGkDbZsKbSYioDBTuS8mKKBkF7atjV8cb1cKh0N10yhyBrwDssu64UIM7mfpWna6ik4 pBE2bWPJ3HeSQSHU7PPmM+nyM09Wv36UvISwm9zuIefILalTwqCxGQT1Mqm/3gg6Z4FK aL1ispJ56/Uud0VoiN53IowL+uup68rmVmKWHiPHtXOwvInnMI8KRCnFcsrc7F/5yv2i RxJA== MIME-Version: 1.0 X-Received: by 10.66.164.229 with SMTP id yt5mr4198342pab.67.1392325275108; Thu, 13 Feb 2014 13:01:15 -0800 (PST) In-Reply-To: References: <4cc09129-43ee-4205-a24c-03f92b594abc@googlegroups.com> Date: Fri, 14 Feb 2014 08:01:15 +1100 Subject: Re: A curious bit of code... 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392325278 news.xs4all.nl 2848 [2001:888:2000:d::a6]:33752 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66240 On Fri, Feb 14, 2014 at 7:55 AM, Emile van Sebille wrote: > On 2/13/2014 11:59 AM, Zachary Ware wrote: >> >> In a fit of curiosity, I did some timings: > > > Snip of lots of TMTOWTDT/TIMTOWTDI/whatever... timed examples :) > > But I didn't see this one: > > s[::len(s)-1] .... AAAAAAAAAAAAAAAAAAARGGGGGGGGGGHHHH! Really, I actually did pause, double-take, and then scream under my breath, when I saw that. Yes, it works. But please, if you EVER do this, save me the trouble and just submit your code to thedailywtf.com straight away! ChrisA