[ZPT] TALES: Path expressions?

Evan Simpson evan@zope.com
Wed, 06 Mar 2002 09:52:21 -0500


Joel Burton wrote:
> Possibly. But Python expressions lead to some ugliness, such as when
> dealing with objects with a . in their name, and having to know whether
> something is callable () or not.
> 
>   here/foo/submit.html
> 
> is easier and nicer than
> 
>   here.foo['submit.html']()
> 
> plus I think independence from Python was one of design intentions of the
> ZPT package.

Both quite true, and related.  The language-independent concept of 
'paths' used here is deliberately similar to Zope's own URL-to-object 
mapping.  You can address an object without having to worry about the 
underlying details of resolving that address.  While it is true that the 
resolver function can be exposed to Python (and is!), 
"python:path('foo/bar')" is both less efficient to execute and less 
clear than "foo/bar".

Cheers,

Evan @ Zope