All pastes #263606 Raw Edit

Doow

public python v1 · immutable
·published 2006-12-01 17:51 UTC
rendered paste body
class Karl:    "some class for testing concepts and syntax"    a = []    def __setitem__(self, a, aa):         a = aa        print " ".join(["setitem", str(a), "=", str(aa)])    def __getitem__(self, a):         print " ".join(["getitem", str(a)])        return ainteraction:>>> import test3>>> hej = test3.Karl()>>> hej[""]getitem ''>>> hej[""] = [1,2]setitem [1, 2] = [1, 2]>>> hej[""]getitem ''