[issue15837] Added test to test_random.py testing Random.shuffle

Alessandro Moura report at bugs.python.org
Mon Sep 3 20:06:24 CEST 2012


Alessandro Moura added the comment:

Comparing the execution time with and without the int=int argument of this command:

amoura at amoura-laptop:~/cpython$ time ./python -c "from random import shuffle; lst=list(range(1000000)); shuffle(lst); print (len(lst))"

I get with int=int:

real	0m13.755s
user	0m13.777s
sys	0m0.124s

and without it:

real	0m13.876s
user	0m13.701s
sys	0m0.116s

So it makes no difference in practice. On the other hand, removing this has a chance of braking existing code, if someone somewhere actually uses the third argument for something - I can't image what, but still...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15837>
_______________________________________


More information about the Python-bugs-list mailing list