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

Lennart Regebro lennart@regebro.nu
Fri, 07 Mar 2003 19:10:13 +0100


Steve Alexander wrote:

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


I don't see the problem with that, unless a or b actually do stuff, and 
modify stuff, and if it does, in ZPT it should then be put into a 
script, since the template itself shouldn't contain any business logic.

I can see the use of a one-line if-else syntax in ZPT as a way to set an 
attribute without making a specific pythons script just for such a small 
  piece of code, and this will do it.

If you want to *DO* different stuff depending on a condition, that 
shouldn't be in the template.

Also, Evan tells me that this already exists in python: expressions, and 
is called test(). So, problem solved, no additional uglyfication of 
Python is needed. :)