class BredList(list):
def __eq__(self, other):
if isinstance(other, int) and self.__len__() > other == self[other]:
return self[other]
return super().__eq__(other)
a = BredList(range(5))
b = list(range(5))
print(a == 2, a == 4)
print(b == 2, b == 4)
commands = {
'A': t.forward
'B': t.forward
'+': t.rotate
'-': t.rotate
}
commands[command]()