[O] A1 P2 .__contains__ Explanation

This commit is contained in:
Linxi Li
2022-01-23 21:18:47 -05:00
parent 04e7def83e
commit bad39fbbd9
+4
View File
@@ -364,6 +364,10 @@ def handle_mouse_click(lst: LinkedList, event: pygame.event.Event,
# Right-click - Search
if event.button == 3:
# It's better to use (i in lst) here but python-ta gives us errors
# (i in lst) will trigger W0104 (pointless-statement)
# print(i in lst) will trigger E9998 (forbidden-IO-function)
# a = i in lst will trigger W0612 (unused-variable)
lst.__contains__(lst[i])