Solved by soulitzer in post #8 
              
              
                It is good to consider the alternatives indeed - the counter method might work also: 
One way to do it is actually save the counter as the functions default argument! This avoids maintaining an extra global set of counters for each parameter. 
fns = []

for i in range(10):
    def fn(x = [0]):
     …