summaryrefslogtreecommitdiff
path: root/Lib/bisect.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-11-24 23:31:59 +0100
committerVictor Stinner <victor.stinner@gmail.com>2016-11-24 23:31:59 +0100
commit1018fad6a4df3d7fcb0ec715867069044428a759 (patch)
tree53d526d206fdf09058367ed28892b3d270242aa9 /Lib/bisect.py
parented6de7345e7bc85e12da6e72f86ab69b2fd8c2dd (diff)
downloadcpython-git-1018fad6a4df3d7fcb0ec715867069044428a759.tar.gz
Issue #28792: Remove aliases from _bisect
Remove aliases from the C module. Always implement bisect() and insort() aliases in bisect.py Remove also the "# backward compatibility" command, there is no plan to deprecate nor remove these aliases. When keys are equal, it makes sense to use bisect.bisect() and bisect.insort().
Diffstat (limited to 'Lib/bisect.py')
-rw-r--r--Lib/bisect.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/bisect.py b/Lib/bisect.py
index 4a4d05255e..7732c639e3 100644
--- a/Lib/bisect.py
+++ b/Lib/bisect.py
@@ -19,8 +19,6 @@ def insort_right(a, x, lo=0, hi=None):
else: lo = mid+1
a.insert(lo, x)
-insort = insort_right # backward compatibility
-
def bisect_right(a, x, lo=0, hi=None):
"""Return the index where to insert item x in list a, assuming a is sorted.
@@ -42,8 +40,6 @@ def bisect_right(a, x, lo=0, hi=None):
else: lo = mid+1
return lo
-bisect = bisect_right # backward compatibility
-
def insort_left(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
@@ -90,3 +86,7 @@ try:
from _bisect import *
except ImportError:
pass
+
+# Create aliases
+bisect = bisect_right
+insort = insort_right