On 5/15/09 10:23 AM, Malthe Borch wrote:
> Atm there's a little known piece of AST magic in Chameleon (affecting
> all implementations): it makes attribute-access (__getattr__) fall
> back to dictionary acces (__getitem__).
> So that's magic; it was invented in the very early stages of the
> compiler and never really evaluated upon––I've later come to think
> it's a sick feature, because why should Python in templates behave
> differently than in code? As you can imagine, it's expensive, too,
> because all attribute lookups carry the cost of a function call.
> So unless there are big complaints, I suggest we just pull it out,
> before anyone notices.

Ow.  -1.   Although I agree it probably never should have worked, we have 
hundreds of templates in production depending upon it now in arbitrary and 
fiddly ways.  It would be quite painful to change all these even if there was 
first a deprecation period.

"Persistence means always having to say you're sorry".

- C
Repoze-dev mailing list

Reply via email to