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: random.randrange removed support for non-integer types after just one release of deprecation
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: hroncok, pablogsal, rhettinger
Priority: normal Keywords: patch

Created on 2022-02-03 10:52 by hroncok, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31098 merged hroncok, 2022-02-03 11:09
Messages (3)
msg412436 - (view) Author: Miro Hrončok (hroncok) * Date: 2022-02-03 10:52
In https://github.com/python/cpython/commit/5afa0a411243210a30526c7459a0ccff5cb88494 the support for non-integer types was removed from random.randrange().

This change is not backward-compatible and it breaks 3rd party code, for example:

simplewrap: https://bugzilla.redhat.com/show_bug.cgi?id=2050093
numpy-stl: https://bugzilla.redhat.com/show_bug.cgi?id=2050092 == https://github.com/WoLpH/numpy-stl/issues/188

That support was only deprecated in Python 3.10 and it needs to remain deprecated for at least two Python releases. Please revert this change from Python 3.11 and wait for at least Python 3.12.

See https://www.python.org/dev/peps/pep-0387/#making-incompatible-changes

When you do remove this from Python 3.12, please make sure to document it in the What's new document.

Thank you.
msg412437 - (view) Author: Miro Hrončok (hroncok) * Date: 2022-02-03 11:09
Proposed the revert at https://github.com/python/cpython/pull/31098
msg412442 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2022-02-03 13:48
New changeset 6baa98e538b2e26f16eaaf462f99496e98d2cfb1 by Miro Hrončok in branch 'main':
bpo-46624: Defer to 3.12: "Remove deprecated support for non-integer values" (GH-31098)
https://github.com/python/cpython/commit/6baa98e538b2e26f16eaaf462f99496e98d2cfb1
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90782
2022-02-03 13:48:43rhettingersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-02-03 13:48:21rhettingersetmessages: + msg412442
2022-02-03 11:09:26hroncoksetmessages: + msg412437
2022-02-03 11:09:13hroncoksetkeywords: + patch
stage: patch review
pull_requests: + pull_request29283
2022-02-03 10:52:01hroncokcreate