FW: [Python-Dev] conditional expressions?
opengeometry at yahoo.ca
Tue Oct 16 12:30:24 CEST 2001
On Tue, Oct 16, 2001 at 09:00:05AM +0000, gbreed at cix.compulink.co.uk wrote:
> > > A conditional expression analogy to list comprehensions would be x
> > > = (a if b else c)
> You can also remove the parentheses, and not have to worry about the
> "if" starting a new line.
I believe Perl and Ruby has
x = a if b
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
8 CPU cluster, Linux (Slackware), Python, LaTeX, Vim, Mutt, Tin
More information about the Python-list