This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: random.shuffled
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.6
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: mark.dickinson, palaviv, rhettinger, terry.reedy
Priority: normal Keywords: patch

Created on 2016-02-19 19:32 by palaviv, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
random-shuffled.patch palaviv, 2016-02-19 19:32 review
Messages (3)
msg260529 - (view) Author: Aviv Palivoda (palaviv) * Date: 2016-02-19 19:32
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.
msg260934 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-02-27 09:25
It is against our policy to wrap random half-line expressions as new function.  Doing so would bloat Python until it became unusable.  This should be rejected.
msg260944 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-02-27 19:56
I concur with Terry.
Date User Action Args
2022-04-11 14:58:27adminsetgithub: 70581
2020-08-02 10:50:09serhiy.storchakalinkissue41457 superseder
2016-02-27 19:56:07rhettingersetstatus: open -> closed
assignee: rhettinger
resolution: rejected
messages: + msg260944
2016-02-27 09:25:59terry.reedysetnosy: + terry.reedy
messages: + msg260934
2016-02-19 19:32:21palavivcreate