summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_collections.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r--Lib/test/test_collections.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 2099d23..0b7cb58 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -1721,6 +1721,18 @@ class TestCollectionABCs(ABCTestCase):
mss.clear()
self.assertEqual(len(mss), 0)
+ # issue 34427
+ # extending self should not cause infinite loop
+ items = 'ABCD'
+ mss2 = MutableSequenceSubclass()
+ mss2.extend(items + items)
+ mss.clear()
+ mss.extend(items)
+ mss.extend(mss)
+ self.assertEqual(len(mss), len(mss2))
+ self.assertEqual(list(mss), list(mss2))
+
+
################################################################################
### Counter
################################################################################