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

Created on 2020-05-01 08:31 by rhettinger, last changed 2020-05-31 08:14 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19867 merged rhettinger, 2020-05-02 19:03
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 ;-)

https://docs.python.org/3/library/random.html#random.shuffle
msg367828 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-05-01 09:22
+1
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)
https://github.com/python/cpython/commit/190fac99c58232f3e0b34891872b91e50ea2f057
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

https://github.com/pre-commit/pre-commit/issues/1479
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?
History
Date User Action Args
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