[Zope-dev] Re: [Vote] PEP308 voting began

Steve Alexander steve@cat-box.net
Fri, 07 Mar 2003 17:15:06 +0200


> The method if_else would look like:
> 
> def if_else(c, a, b):
>     if c:
>         return a
>     else:
>         return b
> 
> 
> I'm not expert in how python expression work, and hence don't know how 
> to make python expressions aware about this method, but I'm sure it's 
> possible, right?

This is possible. But, the problem remains that both a and b (in your 
example above) are evaluated.

The python syntax change, and the TALES syntax change, would mean that 
only one of a and b are evaluated.

--
Steve Alexander