[Python-Dev] New syntax for 'dynamic' attribute access
Delaney, Timothy (Tim)
tdelaney at avaya.com
Mon Feb 12 02:19:02 CET 2007
Ben North wrote:
> c.5 uses which would have to stay as "getattr" because they
> are calls of a variable named "getattr" whose default
> value is the builtin "getattr";
Have you checked if these are intended to bring the "getattr" name into
local scope for fast lookup, or to force a binding to the builtin
"gettattr" at compile time (two common (ab)uses of default arguments)?
If they are, they would be better served by the new syntax.
Overall,
+1 on obj.(attr_name)
-0 on obj.(attr_name, default_value)
Tim Delaney
More information about the Python-Dev
mailing list