Petr Jakes wrote: >>I think you're getting caught by the classic and/or trap in Python, >>trying to avoid using a simple if statement. > > What do you mean by "the classic and/or trap"? Can you give an example > please?
Sure, see my subsequent reply to Cyril, elsewhere in this thread. (In summary, and/or is defective when used as a ternary operator if the expression after "and" evaluates False. The list archives can tell you more.) -Peter -- http://mail.python.org/mailman/listinfo/python-list