[Python-ideas] Shuffled

Mahmoud Hashemi mahmoud at hatnote.com
Tue Sep 6 00:34:05 EDT 2016


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> 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
> 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/20160905/69994476/attachment.html>


More information about the Python-ideas mailing list