class pe():

def __init__(self):

self.lis=[1,2,3]

def __getitem__(self,itm):

return self.lis[itm]

p=pe()

for i in p:

print(i)



#for循环一个对象