Title: Deprecate the optional *random* argument to random.shuffle()
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: rhettinger, serhiy.storchaka, tim.peters
Priority: normal Keywords: patch

Created on 2020-05-01 08:31 by rhettinger, last changed 2021-05-04 02:58 by Anthony Sottile. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19867 merged rhettinger, 2020-05-02 19:03
PR 25874 merged rhettinger, 2021-05-04 02:57
Messages (5)
msg367826 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-01 08:31
shuffle(x, random=None)    ⟼    shuffle(x)

AFAICT, no one ever uses the optional parameter, nor would they have a valid reason to do so.  It is an ancient API oddity and is inconsistent with the other methods in the module.  I've long been annoyed by it and would like to see it cleaned-up before I retire ;-)
msg367828 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-05-01 09:22
msg367948 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-02 23:45
New changeset 190fac99c58232f3e0b34891872b91e50ea2f057 by Raymond Hettinger in branch 'master':
bpo-40465: Deprecate the optional argument to random.shuffle(). (#19867)
msg370417 - (view) Author: Anthony Sottile (Anthony Sottile) * Date: 2020-05-31 07:55
pre-commit uses this to do deterministic shuffling, please don't remove this
msg370418 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-05-31 08:14
Raymond, could you please add an entry in What's New?
Date User Action Args
2021-05-04 02:58:55Anthony Sottilesetnosy: - Anthony Sottile
2021-05-04 02:57:09rhettingersetpull_requests: + pull_request24553
2020-05-31 08:14:51serhiy.storchakasetmessages: + msg370418
2020-05-31 07:55:35Anthony Sottilesetnosy: + Anthony Sottile
messages: + msg370417
2020-05-02 23:49:03rhettingersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-05-02 23:45:35rhettingersetmessages: + msg367948
2020-05-02 19:03:13rhettingersetkeywords: + patch
stage: patch review
pull_requests: + pull_request19180
2020-05-01 09:22:58serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg367828
2020-05-01 08:31:41rhettingercreate