class Stuff: def __init__(self): self.modes = { 'wee': self.things } self.modes['wee']() def things(self): print "OK" Stuff()