{}
run-icon
main.py
import threading def mess_blocks(): block.insert(0, 1) class Myclass: def __init__(self, val): self.value = val def __eq__(self, other): if self.value == other.value: thr = threading.Thread(target=mess_blocks) thr.start() thr.join() return self.value == other.value def __repr__(self): return f"{{value = {self.value}}}" block = [Myclass(i) for i in range(5)] # one block in the linked list block.remove(Myclass(3)) print(block)
Output