[ZPT] | inefficiency/bug

Ron Bickers rbickers-dated-1017948130.13a34b@logicetc.com
Thu, 28 Mar 2002 14:22:09 -0500


> -----Original Message-----
> From: zpt-admin@zope.org [mailto:zpt-admin@zope.org]On Behalf Of Chris
> Withers

> In the expression:
>
> <tal:r replace="x | y | z">

I recently had a similar issue with the test() function.  Perhaps they're
related?

  test(a, a[b], c)

Since all three are always evaluated, a[b] gives an error even if the test
for 'a' is false.

The current solution is to exploit Python's short circuiting, as in:

  python:(a and a[b]) or c

> What's the best way to tackle this?

The best way, IMO, would be to "fix" | to mirror Python's behavior.
_______________________

Ron Bickers
Logic Etc, Inc.