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.

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: hugovk, rhettinger, serhiy.storchaka, tim.peters, vstinner
Priority: normal Keywords: patch

Created on 2020-05-01 08:31 by rhettinger, last changed 2022-04-11 14:59 by admin. 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
PR 31818 open hugovk, 2022-03-17 15:22
Messages (8)
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?
msg415418 - (view) Author: Hugo van Kemenade (hugovk) * (Python triager) Date: 2022-03-17 15:22
GH-31818 adds an entry to What's New in 3.11.
msg415940 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-03-24 13:23
New changeset 12c0012cf97d21bc637056983ede0eaf4c0d9c33 by Tomáš Hrnčiar in branch 'main':
bpo-40465: Document random module changes in 3.11 What's new (#31818)
https://github.com/python/cpython/commit/12c0012cf97d21bc637056983ede0eaf4c0d9c33
msg415941 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-03-24 13:29
commit 70a071d9e1d65f8c168b4b96a18c86d5230789c5
Author: Raymond Hettinger <rhettinger@users.noreply.github.com>
Date:   Tue May 4 01:55:40 2021 -0700

    bpo-40465: Remove random module features deprecated in 3.9 (GH-25874)
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84645
2022-03-24 13:29:22vstinnersetnosy: + vstinner
messages: + msg415941
2022-03-24 13:23:23serhiy.storchakasetmessages: + msg415940
2022-03-17 15:22:59hugovksetnosy: + hugovk

messages: + msg415418
pull_requests: + pull_request30050
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