[New-bugs-announce] [issue26393] random.shuffled

Aviv Palivoda report at bugs.python.org
Fri Feb 19 14:32:21 EST 2016

New submission from Aviv Palivoda:

I am suggesting adding random.shuffled to the random module. This is very similar to the shuffle function just return a new shuffled list instead of in place shuffle. This is very similar to the sorted and list.sort.

As you can see in the patch the shuffled function just return random.sample(x, len(x)) as this is what i usually do when i want to get back a shuffled list.

components: Library (Lib)
files: random-shuffled.patch
keywords: patch
messages: 260529
nosy: mark.dickinson, palaviv, rhettinger
priority: normal
severity: normal
status: open
title: random.shuffled
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41976/random-shuffled.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list