(-1)**1000

wxjmfauth at gmail.com wxjmfauth at gmail.com
Wed Oct 22 13:35:59 CEST 2014


Le mercredi 22 octobre 2014 10:54:51 UTC+2, Chris Angelico a écrit :
> 
> 
> 
> Poor performance is a crime. Python is innocent until proven guilty.
> And the burden of proof is seldom met.
> 
> 

>>> timeit.repeat("('abc'*1000 +'z')[:-1]")
[1.4107052484530875, 1.3924774653606349, 1.3934069318508087]
>>> timeit.repeat("('abc'*1000 +'EURO')[:-1]")
[5.427585698976522, 5.39270195514851, 5.40894516974776]
>>>

Not only this disastrous (and systematic) behaviour
is explainable, I have no problem to explain this
to those who wish to listen.

jmf



More information about the Python-list mailing list