A curious bit of code...

Zachary Ware zachary.ware+pylist at gmail.com
Thu Feb 13 22:19:52 CET 2014


On Thu, Feb 13, 2014 at 2:55 PM, Emile van Sebille <emile at fenx.com> 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



More information about the Python-list mailing list