[ZPT] Memory Leak still?

Evan Simpson evan@zope.com
Mon, 10 Dec 2001 14:05:47 -0500


Ron Bickers wrote:

> I'm not sure I follow 100%, but the reason I used python:path('item/url') or
> nothing instead of just item/url | nothing was so that the existence *and*
> value of item/url would determine whether the 'or' would be used.  With just
> item/url | nothing, if item/url existed (whether true or false), 'nothing'
> would never be used.  So how would I do this now?

In either case, if it exists and is true, then the 'or' isn't used.  Do you 
want to force the false value to be 'nothing' for some reason?  If so, you 
could write "python:path('item/url | nothing') or nothing", but why?

This does point up the case where you want something that acts like '|' but 
catches false values as well, so you can write an expression like 
"request/foo ??? foodefault", and have whatever operator would go in place 
of '???' evaluate the expression to foodefault if 'request/foo' doesn't 
exist or is false.

I've also thought about allowing the final part of a path with '|'s be an 
arbitrary expression, so that you could write "request/foo | string:wheee"
or "request/foo | python:1".  The only problem I see would be that this 
would force '|'-quoting in the tail expression.

Cheers,

Evan @ Zope