Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7c4f96f

Browse files
committed
Deviant1 didn't work as advertised
1 parent 37b1a26 commit 7c4f96f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/test/test_contains.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ class Deviant1:
140140
works when the list is modified during the check.
141141
"""
142142

143-
aLongList = range(15)
144-
aShortList = range(5)
145-
aList = aLongList
143+
aList = range(15)
146144

147145
def __cmp__(self, other):
148146
if other == 12:
149-
self.aList = self.aShortList
147+
self.aList.remove(12)
148+
self.aList.remove(13)
149+
self.aList.remove(14)
150150
return 1
151151

152152
check(Deviant1() not in Deviant1.aList, "Deviant1 failed")

0 commit comments

Comments
 (0)