[Python-ideas] About adding a new iteratormethodcalled "shuffled"

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Wed Mar 25 22:41:27 CET 2009


On Wed, Mar 25, 2009 at 13:28, Steven D'Aprano <steve at pearwood.info> wrote:

> Don't get me wrong, random.shuffle() is perfectly adequate for any
> use-case I can think of. But beyond 2080 items in the list, it becomes
> greatly biased, and I think that's important to note in the docs. Those
> who need to know about it will be told, and those who don't care can
> continue to not care.

Why anyone would care? Orderings possible to obtain from a given good
random number generator are quite uniformly distributed among all
orderings. I bet you can't even predict any particular ordering which
is impossible to obtain. There is no time to generate all orderings.
The factorial of large numbers is just huge.

-- 
Marcin Kowalczyk
qrczak at knm.org.pl
http://qrnik.knm.org.pl/~qrczak/



More information about the Python-ideas mailing list