Distinguishing attributes and methods
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Sat Dec 8 15:36:56 EST 2007
On Sat, 08 Dec 2007 11:44:36 -0800, MonkeeSage wrote:
> On Dec 8, 12:56 pm, Bruno Desthuilliers
>> callable attributes are not necessarily methods, and are still
>> 'variables' anyway.
>
> I think it muddies the water to say that a.a() and a.a are the same
> thing--obviously they are not. In the common case, the first is a
> method, and the second is a variable.
No, the first is a call of `a.a` while the second is just referencing
`a.a`. And `a.a` is a "variable" no matter if it refers to a callable or
not. Variables are name to object bindings and methods are objects.
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list