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!newsfeed2.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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'builtin': 0.09; 'lookup': 0.09; 'itself.': 0.14; '11:59': 0.16; 'subject:bit': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'thu,': 0.19; 'examples': 0.20; 'fit': 0.20; '(the': 0.22; 'feb': 0.22; 'to:name :python-list@python.org': 0.22; 'gets': 0.27; 'van': 0.27; 'header :In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; '13,': 0.31; 'but': 0.35; 'received:google.com': 0.35; "didn't": 0.36; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'skip:t 30': 0.61; 'ware': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=J0W4trGjLs+36yi5Su5f2heGrA0veLMWBNcKGwHVAg0=; b=c9G6D3YHUm95PRq/0D3R5jwMjYdF5hfotH590GDyRV0G6pnTp+6l9abBUBMfKV37O0 SHpJMJ1cgI8r/dEoIDAwqutI2vaYlloq2rood1wwTmhwrcdVnuauXgoMGZHEVqeAJpeD Jl0m9nLePo0EqMvyfr/zHQnCSip8seyAKzCC7j8l37n6IubBAmT9A5Ia2ZZAj+hqyjUY +oN+ojZV53mEbP20IE6aoJaeNa/YOhqJd708gNL9sBxJE7vldp+8FI6I1cO19WKbUNx9 76TFfW/WJcWK4VyWrRRapLI/Vf+ZVhyRt+OQQHSNhL7eWfQbXWetopq0G9G2LmqU1C/K 7BQw== X-Received: by 10.205.42.129 with SMTP id ty1mr3612768bkb.9.1392326412098; Thu, 13 Feb 2014 13:20:12 -0800 (PST) MIME-Version: 1.0 Sender: zachary.ware@gmail.com In-Reply-To: References: <4cc09129-43ee-4205-a24c-03f92b594abc@googlegroups.com> From: Zachary Ware Date: Thu, 13 Feb 2014 15:19:52 -0600 X-Google-Sender-Auth: pCqi-0qkI_jn-m7-iZaYfYUnoSY Subject: Re: A curious bit of code... To: "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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392326419 news.xs4all.nl 2864 [2001:888:2000:d::a6]:54449 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66247 On Thu, Feb 13, 2014 at 2:55 PM, 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] It's not great, around 0.520 usec (the builtin lookup and function call is what gets it). Also, uglier than sin itself. -- Zach