On 2005-10-05, Wenhua Zhao <[EMAIL PROTECTED]> wrote: > a = b | 1
Yes, Python supports that expression. > a = b if b != nil > else a =1 But that's not what it means. > Is there such expression in python? >>> b=0 >>> b = 0 >>> a = b | 1 >>> a 1 >>> b = 1 >>> a = b | 1 >>> a 1 >>> b = 2 >>> a = b | 1 >>> a 3 >>> I'm not sure what What you mean by "nil", but I would geuess this is the equivalent Python: if b is not None: a = b else: a = 1 -- Grant Edwards grante Yow! .. Do you like at "TENDER VITTLES?"? visi.com -- http://mail.python.org/mailman/listinfo/python-list