[Zope-dev] Re: ZPT: defer expression fix

Christian Heimes heimes at faho.rwth-aachen.de
Sat Apr 2 11:01:15 EST 2005


Evan Simpson wrote:
> Christian Heimes wrote:
> 
>>  * DeferWrapper didn't cache the result of the expression like 
>> ordinary vars do.
> 
> 
> This was intended, though you couldn't know that since I never 
> documented this.  Consider the following terrible example:
> 
> <div tal:define="xis defer:string:x is $x">
>   <p tal:repeat="x python:range(3)"
>      tal:content="xis"></p>
> </div>
> 
> This should evaluate to:
> 
> <div>
>   <p>x is 0</p>
>   <p>x is 1</p>
>   <p>x is 2</p>
> </div>
> 
> Why??  I don't remember why I wanted this behavior; it was an 
> experiment, and I can't find any code of mine that uses it.

That's an interessting use case. Do you want me to keep the code and 
make up a new expression? I'm thinking about "lazy:".

Christian



More information about the Zope-Dev mailing list