[Zope-dev] Re: TALES idea: tuple unpacking

Chris Withers chrisw@nipltd.com
Tue, 29 Jul 2003 18:20:52 +0100


Evan Simpson wrote:

> 'key:' -- use item access with the prefixed string.
> 'index:' -- use item access with the prefixed integer.
> 'attr:' -- use attribute access with the prefixed string.
> 
> In each case, the path traversal fails if the specified access method 
> fails, rather than trying other access methods.  This would allow 
> "options/a_mapping/key:items/index:0" rather than 
> "python:options['a_mapping']['items'][0]".

What an extraordinarily good idea! Why has none of us thought of this before?

Like it :-)

Chris