Re: Conditional Expressions in Python 2.4

2006-06-02 Thread bruno at modulix
A.M wrote: Hi, I am using Python 2.4. I read the PEP 308 at: http://www.python.org/dev/peps/pep-0308/ I tried the statement: a= Yes if 1==1 else No but the interpreter doesn't accept it. Do we have the conditional expressions in Python 2.4? No, AFAIK they'll be in for 2.5

Re: Conditional Expressions in Python 2.4

2006-06-02 Thread A.M
a = 1 == 1 and Yes or No a = (No, Yes)[1 == 1] Smart! Thanks alot. -- http://mail.python.org/mailman/listinfo/python-list

Re: Conditional Expressions in Python 2.4

2006-06-02 Thread Steven Bethard
A.M wrote: Do we have the conditional expressions in Python 2.4? bruno at modulix wrote: No, AFAIK they'll be in for 2.5 Yep: Python 2.5a2 (trunk:46491M, May 27 2006, 14:43:55) [MSC v.1310 32 bit (Intel)] on win32 Yes if 1 == 1 else No 'Yes' In the meanwhile, there are (sometime trickyà

Re: Conditional Expressions in Python 2.4

2006-06-02 Thread Bruno Desthuilliers
Steven Bethard a écrit : A.M wrote: Do we have the conditional expressions in Python 2.4? bruno at modulix wrote: (snip) In the meanwhile, there are (sometime trickyà ways to get the same result: a = 1 == 1 and Yes or No a = (No, Yes)[1 == 1] And just to give some examples

Conditional Expressions in Python 2.4

2006-06-01 Thread A.M
Hi, I am using Python 2.4. I read the PEP 308 at: http://www.python.org/dev/peps/pep-0308/ I tried the statement: a= Yes if 1==1 else No but the interpreter doesn't accept it. Do we have the conditional expressions in Python 2.4? Thank you, Alan -- http://mail.python.org

Re: Conditional Expressions in Python 2.4

2006-06-01 Thread Robert Kern
A.M wrote: Do we have the conditional expressions in Python 2.4? No. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http