from java.lang import String from java.util import ArrayList class GoofyListMapThing (ArrayList): def __init__(self): self._elements = {} def __setitem__(self, key, element): print 'GoofyListMapThing::__setitem__' def __getitem__(self, key): print 'GoofyListMapThing::__getitem__' glmt = GoofyListMapThing() glmt['my-key'] = String('el1')