On 09/06/2016 03:37 PM, Sven R. Kunze wrote:

Besides being a silly argument, it's an interesting solution.

Does it really work? I remember Microsoft utilizing a similar approach
for their browser selection tool which led to a skewed probability
distribution. Maybe, I wrong here though.


Yes. The key is evaluated only once, so each element gets a pseudo-random number. Sorting this list leads to a shuffle.

However, a super-linear shuffle, whilst Fisher-Yates is a linear solution and also requires less additional memory.

Lastly, although it is obvious, from a software engineering standpoint, this is a mere weird hack.

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to