[Zope3-dev] Re: RFC: abolishing python: expressions in ZPT TALES
Philipp von Weitershausen
philipp at weitershausen.de
Thu Dec 29 09:49:46 EST 2005
Chris McDonough wrote:
> I'm +1 for deprecating python: expressions in the context of views.
> But I'm not sure what "deprecate" would mean; I doubt they can go away
> entirely given the body of code that exists which uses them.
That doesn't mean they can't go away for sure. It would just mean we'd
have to be careful, perhaps give a longer deprecation period and aid
people in converting their code with good tutorials.
> An interesting thing about python: expressions... I've found that
> simple "python: foo['bar']" expressions are typically faster than their
> path counterparts ("foo/bar") because they are more explicit. This is
> not an argument to use them instead of path expressions, but I thought
> it was interesting regardless in a I-didn't-expect-that kind of way.
>
> If there was even a small speed win in making TALES expression parsing
> faster by removing support for python: in some backwards- incompatible
> mode, that would be a *reason* to deprecate-in-code rather than
> deprecate-in-documentation.
I think it would be quite possible to do explicit key or attribute
lookup with TALES, e.g.:
foo/attr:bar (for foo.bar)
foo/key:bar (for foo['bar'])
foo/item:1 (for foo[1])
Philipp
More information about the Zope3-dev
mailing list