def f1(): ... def f2(): ... handlers = {'club': f1, 'heart': f2, ...} suit = 'club' handlers[suit]() -------------------------------- def club(): .... suit = 'club' eval(suit)() ------------------------------ class Handlers(): def handle(...): ... class club(Handler): def handle(): ... class heart(Handler): def handle()... eval(suit)().handle()