spliting on ":"

Peter Hansen peter at engcorp.com
Sat Mar 4 19:24:33 EST 2006


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




More information about the Python-list mailing list