| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ed6de73 commit 1018fad
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,8 +19,6 @@ def insort_right(a, x, lo=0, hi=None): | |||
| 19 | 19 | else: lo = mid+1 | |
| 20 | 20 | a.insert(lo, x) | |
| 21 | 21 | ||
| 22 | - insort = insort_right # backward compatibility | ||
| 23 | - | ||
| 24 | 22 | def bisect_right(a, x, lo=0, hi=None): | |
| 25 | 23 | """Return the index where to insert item x in list a, assuming a is sorted. | |
| 26 | 24 | ||
@@ -42,8 +40,6 @@ def bisect_right(a, x, lo=0, hi=None): | |||
| 42 | 40 | else: lo = mid+1 | |
| 43 | 41 | return lo | |
| 44 | 42 | ||
| 45 | - bisect = bisect_right # backward compatibility | ||
| 46 | - | ||
| 47 | 43 | def insort_left(a, x, lo=0, hi=None): | |
| 48 | 44 | """Insert item x in list a, and keep it sorted assuming a is sorted. | |
| 49 | 45 | ||
@@ -90,3 +86,7 @@ def bisect_left(a, x, lo=0, hi=None): | |||
| 90 | 86 | from _bisect import * | |
| 91 | 87 | except ImportError: | |
| 92 | 88 | pass | |
| 89 | + | ||
| 90 | + # Create aliases | ||
| 91 | + bisect = bisect_right | ||
| 92 | + insort = insort_right | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -216,18 +216,11 @@ If x is already in a, insert it to the left of the leftmost x.\n\ | |||
| 216 | 216 | Optional args lo (default 0) and hi (default len(a)) bound the\n\ | |
| 217 | 217 | slice of a to be searched.\n"); | |
| 218 | 218 | ||
| 219 | - PyDoc_STRVAR(bisect_doc, "Alias for bisect_right().\n"); | ||
| 220 | - PyDoc_STRVAR(insort_doc, "Alias for insort_right().\n"); | ||
| 221 | - | ||
| 222 | 219 | static PyMethodDef bisect_methods[] = { | |
| 223 | 220 | {"bisect_right", (PyCFunction)bisect_right, | |
| 224 | 221 | METH_VARARGS|METH_KEYWORDS, bisect_right_doc}, | |
| 225 | - {"bisect", (PyCFunction)bisect_right, | ||
| 226 | - METH_VARARGS|METH_KEYWORDS, bisect_doc}, | ||
| 227 | 222 | {"insort_right", (PyCFunction)insort_right, | |
| 228 | 223 | METH_VARARGS|METH_KEYWORDS, insort_right_doc}, | |
| 229 | - {"insort", (PyCFunction)insort_right, | ||
| 230 | - METH_VARARGS|METH_KEYWORDS, insort_doc}, | ||
| 231 | 224 | {"bisect_left", (PyCFunction)bisect_left, | |
| 232 | 225 | METH_VARARGS|METH_KEYWORDS, bisect_left_doc}, | |
| 233 | 226 | {"insort_left", (PyCFunction)insort_left, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments