I tried to add 4 methods in a list (methodList):
def setVar(self, number):
self.var = number
methodList = list()
for y in range(4):
methodList.append(setVar(self, y))
and the function does not work:
>>> self.var = 0
>>> methodList[1]
>>> print(self.var)
0
If it works it would look like this:
>>> self.var = 0
>>> methodList[1]
>>> print(self.var)
1
Then I started the function to see:
>>> print(methodList[1])
None
Where did I go wrong?