Christof Winter <winter at biotec.tu-dresden.de> writes: > To get rid of the if statements, replace __init__ function with: > > def __init__(self, tc): > functionToCall = eval("self.testCase%s" % tc) Or functionToCall = getattr(self, "testCase" + tc) eval can introduce unwanted side effects.