Distinguishing attributes and methods

MonkeeSage MonkeeSage at gmail.com
Sat Dec 8 14:44:36 EST 2007


On Dec 8, 12:56 pm, Bruno Desthuilliers
<bdesth.quelquech... at free.quelquepart.fr> wrote:
> MonkeeSage a écrit :
>
>
>
> > On Dec 8, 2:10 am, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
>
> >>On Fri, 07 Dec 2007 23:19:40 -0800, tjhnson wrote:
>
> >>>With properties, attributes and methods seem very similar.  I was
> >>>wondering what techniques people use to give clues to end users as to
> >>>which 'things' are methods and which are attributes.
>
> >>Methods are attributes.  So the decision is easy -- everything on an
> >>object is an attribute.  ;-)
>
> >>Ciao,
> >>        Marc 'BlackJack' Rintsch
>
> > I think he means callable attributes (methods) and non-callable
> > attributes (variables).
>
> 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. Yes, you can do silly stuff,
such that this rule will not hold, but in general it does. Or am I
wrong?

Regards,
Jordan



More information about the Python-list mailing list