class A(object): def __init__(self): self.X = [] def f(self): for i in range(10): self.X.append(i) a = A() a.f() print('End')