On 4/9/10 20:30 , Hanno Schlichting wrote:
> <ul tal:repeat="item items">
>    <li tal:condition="view.useIcons()">
>      icon
>    </li>
>    <li tal:condition="not view.useIcons()">
>      text
>    </li>
> </ul>
> You can easily save 2 * len(items) function calls here, by using one
> more temporary variable. I haven't figured out who or what code should
> do something to avoid this yet :)

You can't do that. For all you know iterating over items might have a 
side-effect which influences the result of view.useIcons.

Repoze-dev mailing list

Reply via email to