While I think you're probably right, I know for a fact there are plenty of
templates in the wild that assume you can use attribute syntax for
dictionary lookup. At least on the stuff I'm working on.
Maybe add deprecation warnings to the next release and actually yank it out
release after that?
On Fri, May 15, 2009 at 10:23 AM, Malthe Borch <mbo...@gmail.com> 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.
> Repoze-dev mailing list
Repoze-dev mailing list