On Tue, 21 Aug 2007 21:56:18 +0200, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>Christof Winter <[EMAIL PROTECTED]> 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. Hence the slogan "Do No Eval!" wwwayne -- http://mail.python.org/mailman/listinfo/python-list