Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit afe5e96

Browse filesBrowse files
authored
Merge pull request #4774 from MegasKomnenos/bisect
Update bisect.py and test_bisect.py from CPython v3.11.2
2 parents 6f8a652 + d39ddac commit afe5e96
Copy full SHA for afe5e96

File tree

Expand file treeCollapse file tree

2 files changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-2
lines changed

‎Lib/bisect.py

Copy file name to clipboardExpand all lines: Lib/bisect.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ def bisect_left(a, x, lo=0, hi=None, *, key=None):
107107

108108
# Create aliases
109109
bisect = bisect_right
110-
insort = insort_right
110+
insort = insort_right

‎Lib/test/test_bisect.py

Copy file name to clipboardExpand all lines: Lib/test/test_bisect.py
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
py_bisect = import_helper.import_fresh_module('bisect', blocked=['_bisect'])
8-
c_bisect = import_helper.import_fresh_module('bisect', fresh=['bisect'])
8+
c_bisect = import_helper.import_fresh_module('bisect', fresh=['_bisect'])
99

1010
class Range(object):
1111
"""A trivial range()-like object that has an insert() method."""
@@ -257,6 +257,12 @@ def test_insort(self):
257257
target
258258
)
259259

260+
def test_insort_keynotNone(self):
261+
x = []
262+
y = {"a": 2, "b": 1}
263+
for f in (self.module.insort_left, self.module.insort_right):
264+
self.assertRaises(TypeError, f, x, y, key = "b")
265+
260266
class TestBisectPython(TestBisect, unittest.TestCase):
261267
module = py_bisect
262268

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.