[Python-ideas] Shuffled

Sven R. Kunze srkunze at mail.de
Tue Sep 6 11:06:26 EDT 2016


If so, then I would suggest than each list provides a .shuffle method as 
well (just as sorted/sort does).


On 06.09.2016 06:34, Mahmoud Hashemi wrote:
> I tend to agree with Arek. I've been bitten multiple times, including 
> once yesterday, because shuffle works in place, when I really expect a 
> sorted()-like behavior for a standalone function like that.
>
> Mahmoud
> https://github.com/mahmoud
> http://sedimental.org
>
> On Mon, Sep 5, 2016 at 6:59 PM, Arek Bulski <arek.bulski at gmail.com 
> <mailto:arek.bulski at gmail.com>> wrote:
>
>     shuffled() should be in the random module, of course. I dont
>     suggest a builtin. Although now that you mentioned it, I could go
>     for that too.
>
>     There are usage cases where its heavily used, in randomized
>     testing for example. I am sure that there are also other domains
>     where randomization of lists is used.
>
>     Another reason to put it there is that using shuffle is
>     inconvenient. The fact that I CAN write it myself doesnt mean that
>     it doesnt belong in the standard library.
>
>     Implementing this in pure python wont take a lot of work.
>
>     pozdrawiam,
>     Arkadiusz Bulski
>
>
>     _______________________________________________
>     Python-ideas mailing list
>     Python-ideas at python.org <mailto:Python-ideas at python.org>
>     https://mail.python.org/mailman/listinfo/python-ideas
>     <https://mail.python.org/mailman/listinfo/python-ideas>
>     Code of Conduct: http://python.org/psf/codeofconduct/
>     <http://python.org/psf/codeofconduct/>
>
>
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160906/9d25beba/attachment-0001.html>


More information about the Python-ideas mailing list