conditional expressions (RE: Loop-and-a-half (Re: Curious assignment behaviour))

Paul Rubin phr-n2001d at nightsong.com
Mon Oct 15 02:32:19 EDT 2001


"Chris Tavares" <christophertavares at earthlink.net> writes:
> Question - what happens with:
> 
> x = (if e1 then e2 else e3,)  # <--- note trailing comma
> 
> Should be a 1 element tuple, yes? What happens? Or would you have to write:
> 
> x = ((if e1 then e2 else e3),)
> 
> That's just ugly.

I think you could write
   x = (if e1 then e2 else e3),



More information about the Python-list mailing list