[Python-Dev] New syntax for 'dynamic' attribute access (original) (raw)

Neil Toronto ntoronto at cs.byu.edu
Mon Feb 12 08:38:27 CET 2007


Anthony Baxter wrote:

I have to say that I'm not that impressed by either the 1-arg or 2-arg versions. Someone coming across this syntax for the first time will not have any hints as to what it means - and worse, it looks like a syntax error to me. -1 from me.

I'm not sure the "looks like a syntax error" argument holds much weight, because any new syntax is likely to be a syntax error until the syntax is changed. :) "No hints" is a decent argument against it, though. Parenthesis are already used for tuples, function calls, precedence, and generator comprehensions. The more something gets overloaded, the more ambiguous it looks. How about

obj.*str_expression

instead? "*" is pretty common in the C family of languages as a dereferencing operator.

Neil



More information about the Python-Dev mailing list