We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62d071f commit 2e792e6Copy full SHA for 2e792e6
extra_tests/snippets/builtin_list.py
@@ -655,4 +655,17 @@ def __eq__(self, other):
655
l = [1, 2, 3, m, 4]
656
m.list = l
657
l.remove(4)
658
-assert_raises(ValueError, lambda: l.index(4)) # element 4 must not be in the list
+assert_raises(ValueError, lambda: l.index(4)) # element 4 must not be in the list
659
+
660
+# Test no panic occured when list elements was deleted in __eq__
661
+class rewrite_list_eq(list):
662
+ pass
663
664
+class poc:
665
+ def __eq__(self, other):
666
+ list1.clear()
667
+ return self
668
669
+list1 = rewrite_list_eq([poc()])
670
+list1.remove(list1)
671
+assert list1 == []
0 commit comments