Issue 28792: bisect: implement aliases in Python, remove C aliases (original) (raw)

Issue28792

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.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/72978

classification

Title: bisect: implement aliases in Python, remove C aliases
Type: Stage:
Components: Versions: Python 3.7

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: larry, mdk, python-dev, rhettinger, serhiy.storchaka, vstinner, xiang.zhang
Priority: normal Keywords: patch

Created on 2016-11-24 21:07 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bisect.patch vstinner,2016-11-24 21:07 review
Messages (5)
msg281651 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-11-24 21:07
Attached patch simplifies the _bisect module: remove _bisect.bisect and _bisect.insort aliases. Aliases are created in Lib/bisect.py. I wrote the patch to prepare the C code for Argument Clinic, see issue #28754. Note: Lib/test/test_bisect.py already contains two unit tests: def test_backcompatibility(self): self.assertEqual(self.module.bisect, self.module.bisect_right) def test_backcompatibility(self): self.assertEqual(self.module.insort, self.module.insort_right)
msg281653 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2016-11-24 21:10
LGTM
msg281659 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-11-24 21:48
Oh, bisect() was renamed to bisect_right() and insort() renamed to insort_right() in the changeset 67b3ac439f64 of Python 2.1. The aliases created for "backward compatibility" are for compatibility with... Python 2.0 :-) The aliases were never deprecated. Maybe we can also remove/rephrase the "backward compatibility" comment.
msg281666 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-24 22:35
New changeset 45713818fd81 by Victor Stinner in branch 'default': Issue #28792: Remove aliases from _bisect https://hg.python.org/cpython/rev/45713818fd81
msg281667 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-11-24 22:42
I pushed quickly my patch, so Julien can rebase his patch on top of that. I like his patch because it changes bisect to use FASTCALL which makes bisect faster!
History
Date User Action Args
2022-04-11 14:58:40 admin set github: 72978
2016-11-24 22:42:50 vstinner set status: open -> closedresolution: fixed
2016-11-24 22:42:43 vstinner set messages: +
2016-11-24 22:35:45 python-dev set nosy: + python-devmessages: +
2016-11-24 21:57:14 vstinner set nosy: + xiang.zhang
2016-11-24 21:57:01 vstinner set nosy: + serhiy.storchaka
2016-11-24 21:48:56 vstinner set messages: +
2016-11-24 21:10:42 mdk set messages: +
2016-11-24 21:07:47 vstinner create