Skip to content

Commit 7183136

Browse files
committed
added tests to mutable sequence subclass
1 parent 351ea2b commit 7183136

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Lib/test/test_collections.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,17 @@ def insert(self, index, value):
17211721
mss.clear()
17221722
self.assertEqual(len(mss), 0)
17231723

1724+
# issue 34427
1725+
# extending self should not cause infinite loop
1726+
items = 'ABCD'
1727+
mss2 = MutableSequenceSubclass(items + items)
1728+
mss.clear()
1729+
mss.extend(items)
1730+
mss.extend(mss)
1731+
self.assertEqual(len(mss), len(mss2))
1732+
self.assertEqual(list(mss), list(mss2))
1733+
1734+
17241735
################################################################################
17251736
### Counter
17261737
################################################################################

0 commit comments

Comments
 (0)