[Zope3-dev] RFC: abolishing python: expressions in ZPT TALES

Chris McDonough chrism at plope.com
Wed Dec 28 11:55:42 EST 2005


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.

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.

- C

On Dec 28, 2005, at 11:04 AM, Jim Fulton wrote:

> Rocky Burt wrote:
>> Hi all,
>> Please don't mistake this as a proposal or anything of the sort but I
>> was just curious what the rest of the zope3 community thought on this
>> particular topic.  (Please forgive me if this topic has been  
>> exhaused to
>> death already)
>> Its my personal opinion that anytime a page template requires logic
>> complicated enough to warrant using a 'python:' expression, that  
>> logic
>> should be re-thought and placed into a view class.  I know that some
>> python: expressions are fairly simple, but for an HTML designer,  
>> *any*
>> python: portions are dangerous to touch (and shouldn't be touched  
>> by the
>> HTML designer).
>> What do you all think?
>
> +1
>
> Views make it much easier to keep Python code in Python modules.
>
> python expressions should be strongly discouraged in ZPT, IMO.
>
> Jim
>
> -- 
> Jim Fulton           mailto:jim at zope.com       Python Powered!
> CTO                  (540) 361-1714            http://www.python.org
> Zope Corporation     http://www.zope.com       http://www.zope.org
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org
> Unsub: http://mail.zope.org/mailman/options/zope3-dev/chrism% 
> 40plope.com
>



More information about the Zope3-dev mailing list