#!/usr/local/bin/python2 class C: def __init__(self): self.l = [] def __setitem__(self, k, v): self.l[k] = v def __getitem__(self, k): return self.l[k] c = C() c.l[:] += (2,3) c[:] += (1,) print c.l