On 05/02/10 10:58, Steven D'Aprano wrote:
>> > And Python's object system
>> > makes it that the argument to __getattr__ is always a string even though
>> > there might be a valid variable that corresponds to it:
> That is nothing to do with the object system, it is related to the 
> semantics of Python syntax. a.b doesn't mean "apply the binary dot 
> operator to arguments a and b". It is syntactic sugar for "look for an 
> attribute named 'b' on object a". As such, the operands that __getattr__ 
> receives are the object a and the *name* b (implemented as a string).

You just described *exactly* the reason why dot is not, and cannot be an
operator.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to