[issue27964] Add random.shuffled

Tim Peters report at bugs.python.org
Mon Sep 5 22:57:31 EDT 2016


Tim Peters added the comment:

I'm at best -0 on the idea:  very easy to get the effect without it, and hard to imagine it's needed frequently.  `sorted()` is also very easy to mimic, but is used often by all sorts of code.  For example, to display output in a `for key in sorted(dict):` loop, or to create a throwaway sorted list for testing, like:

assert data2[low: high] == sorted(data[low: high])

In my own code, I find hundreds of uses of `sorted()`, but only a few dozen of `random.shuffle()`, and in none of the latter cases would `shuffled()` have been useful.

----------
nosy: +tim.peters
stage:  -> needs patch
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27964>
_______________________________________


More information about the Python-bugs-list mailing list