diff options
author | Georg Brandl <georg@python.org> | 2008-10-08 18:47:17 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-10-08 18:47:17 (GMT) |
commit | f3776a17effc7542826e1453b082ca0877722464 (patch) | |
tree | 707a0fa81eda3e0cf4277c66a9a5b1b2ceea29f6 /Lib/test | |
parent | 06a138690231f62b3624766e09212cc01d7b5faa (diff) | |
download | cpython-f3776a17effc7542826e1453b082ca0877722464.zip cpython-f3776a17effc7542826e1453b082ca0877722464.tar.gz cpython-f3776a17effc7542826e1453b082ca0877722464.tar.bz2 |
#3935: properly support list subclasses in the C impl. of bisect.
Patch reviewed by Raymond.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_bisect.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_bisect.py b/Lib/test/test_bisect.py index 7776cc8..66bae48 100644 --- a/Lib/test/test_bisect.py +++ b/Lib/test/test_bisect.py @@ -196,6 +196,17 @@ class TestInsort(unittest.TestCase): def test_backcompatibility(self): self.assertEqual(self.module.insort, self.module.insort_right) + def test_listDerived(self): + class List(list): + data = [] + def insert(self, index, item): + self.data.insert(index, item) + + lst = List() + self.module.insort_left(lst, 10) + self.module.insort_right(lst, 5) + self.assertEqual([5, 10], lst.data) + class TestInsortPython(TestInsort): module = py_bisect |