On Fri, 07 Dec 2007 09:37:22 +0100, Lars Johansen wrote: > I have a function that looks like this: > > def Chooser(color): > > if color == "RED": > x = term.RED [snip]
> Wouldn there been easier if I could just skip all the "*if's" and just > "return term.color", however this gives a syntax error, are there any > clever way to do this ? Others have answered the immediate question, but I'm kind of surprised that nobody seems to have noticed that Lars is reporting a syntax error instead of an attribute error. I suspect that Lars is actually misreporting the error he gets. That's probably not a good habit to get into :) -- Steven -- http://mail.python.org/mailman/listinfo/python-list