<div dir="ltr"><div><div><div>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.<br><br></div>Mahmoud<br></div><a href="https://github.com/mahmoud">https://github.com/mahmoud</a><br></div><a href="http://sedimental.org">http://sedimental.org</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 5, 2016 at 6:59 PM, Arek Bulski <span dir="ltr"><<a href="mailto:arek.bulski@gmail.com" target="_blank">arek.bulski@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">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.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">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. </div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">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.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Implementing this in pure python wont take a lot of work.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><div><font face="'trebuchet ms', sans-serif">pozdrawiam,</font></div><div><font face="'trebuchet ms', sans-serif">Arkadiusz Bulski</font></div><br></div></div></div></div></div></div></div>
</div>
<br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br></blockquote></div><br></div>