#!/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[:] += (1,2,3) print c.l