[Python-Dev] New syntax for 'dynamic' attribute access

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Feb 12 10:14:52 CET 2007


Georg Brandl wrote:

> For the speed argument -- there were quite a few proposals to take builtins as
> constants under certain conditions, in which case getattr() usage could be
> optimized just as well as new syntax.

Even more aggressively, the compiler could recognise it
and make a direct call to the __getattr__ method, or
maybe even have a new opcode for doing that.

In other words, "special syntax" doesn't necessarily
have to look like special syntax. :-)

--
Greg


More information about the Python-Dev mailing list