Distinguishing attributes and methods

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Sat Dec 8 17:16:43 EST 2007


MonkeeSage a écrit :
> On Dec 8, 2:51 pm, Glenn Hutchings <zond... at googlemail.com> wrote:
> 
>>On Dec 8, 7:44 pm, MonkeeSage <MonkeeS... at gmail.com> wrote:
>>
>>
>>>I think it muddies the water to say that a.a() and a.a are the same
>>>thing--obviously they are not.
>>
>>A thing is not what it is;
>>A thing is what it does.
>>This is the Way of the Duck.
>>
>>    -- Basho (in his "3 extra syllables" phase)
> 
> 
> Bah. Type-by-behavior never impressed me much. And I still think that
> a.a is semantically different from a.a() in python.

It is indeed and very obviously semantically different, and no one said 
it wasn't. The first is an attribute lookup, the second is an attribute 
lookup followed by a call. Now this doesn't make the attribute lookup 
part different in both cases...



More information about the Python-list mailing list