def __repr__(self):
    return 'MyList(' + str(self.mylist) + ')'

def __str__(self):
    return str(self.mylist)

def __getitem__(self, i):
    return self.mylist[i]
a = MyList([1, 2, 3])
print(a)
print(repr(a))
for x in a:
    pass
Эмуляция списка в Python