Re: Distinguishing attributes and methods

2007-12-19 Thread Boris Borcic
MonkeeSage wrote: > what am I missing? To my eyes, when you write: >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. What you are most obviously missing is what's shown

Re: Distinguishing attributes and methods

2007-12-11 Thread Florian Diesch
MonkeeSage <[EMAIL PROTECTED]> wrote: > It seems that I've got a short-circuit somewhere here. I understand > that everything is an object and the the storage/lookup system is > object-agnostic, and that it is only the descriptors (or "tags" as I > called them generically) that determine how an at

Re: Distinguishing attributes and methods

2007-12-10 Thread Bruno Desthuilliers
Steve Howell a écrit : > --- Jan Claeys <[EMAIL PROTECTED]> wrote: > >>To conclude this discussion: >> >> * in Python, methods are attributes >> * in Ruby, attributes are methods >> > > > So clearly one of the languages has it all wrong. ;) > Nope, quite on the contrary, both got it right !-)

Re: Distinguishing attributes and methods

2007-12-10 Thread Bruno Desthuilliers
Jan Claeys a écrit : > Op Sun, 09 Dec 2007 12:44:46 -0800, schreef MonkeeSage: > > >>The point is that just because the attributes are "looked up the same >>way" or whatever, doesn't make them the same *kind* of attribute. To say >>that all attributes are the same in python muddies the water. The

Re: Distinguishing attributes and methods

2007-12-10 Thread Bruno Desthuilliers
MonkeeSage a écrit : > On Dec 10, 7:19 am, Bruno Desthuilliers I'm going to give the "Data Model" section a thorough going-over > again, and try to pay more attention this time(!) ;) Also make sure you read the docs about new-style classes, the descriptor protocol and metaclasses. > Just as a s

Re: Distinguishing attributes and methods

2007-12-10 Thread MonkeeSage
On Dec 10, 7:19 am, Bruno Desthuilliers wrote: > MonkeeSage a écrit : > > > It seems that I've got a short-circuit somewhere here. I understand > > that everything is an object and the the storage/lookup system is > > object-agnostic, and that it is only the descriptors (or "tags" as I > > called

Re: Distinguishing attributes and methods

2007-12-10 Thread Steven D'Aprano
On Mon, 10 Dec 2007 03:56:10 -0800, MonkeeSage wrote: > So, when I say that all callable attributes (or to be more precise, all > callable attributes bound to objects other than toplevel) are "methods," > what am I missing? Everything that isn't a method but is callable. class Callable(object):

Re: Distinguishing attributes and methods

2007-12-10 Thread Bruno Desthuilliers
MonkeeSage a écrit : > It seems that I've got a short-circuit somewhere here. I understand > that everything is an object and the the storage/lookup system is > object-agnostic, and that it is only the descriptors (or "tags" as I > called them generically) "descriptor" is a protocol - an interface

Re: Distinguishing attributes and methods

2007-12-10 Thread MonkeeSage
It seems that I've got a short-circuit somewhere here. I understand that everything is an object and the the storage/lookup system is object-agnostic, and that it is only the descriptors (or "tags" as I called them generically) that determine how an attribute is bound, whether it is bound at all, w

Re: Distinguishing attributes and methods

2007-12-10 Thread Bruno Desthuilliers
MonkeeSage a écrit : > On Dec 8, 4:11 pm, Bruno Desthuilliers (snip) >>> I think it muddies the water to say that a.a() and a.a are the same >>> thing--obviously they are not. >> Indeed. a.a yields the object bound to name 'a' in object a, while a.a() >> yields the value returned by calling the obj

Re: Distinguishing attributes and methods

2007-12-09 Thread Marc 'BlackJack' Rintsch
On Sun, 09 Dec 2007 12:44:46 -0800, MonkeeSage wrote: > On Dec 8, 4:11 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: >> MonkeeSage a écrit : > You're talking about the result of calling a.a(), I'm talking about > what the attribute "a" on the object "a" is. Which is a callable > attribute,

Re: Distinguishing attributes and methods

2007-12-09 Thread Steve Howell
--- Jan Claeys <[EMAIL PROTECTED]> wrote: > > To conclude this discussion: > > * in Python, methods are attributes > * in Ruby, attributes are methods > So clearly one of the languages has it all wrong. ;) ___

Re: Distinguishing attributes and methods

2007-12-09 Thread Jan Claeys
Op Sun, 09 Dec 2007 12:44:46 -0800, schreef MonkeeSage: > The point is that just because the attributes are "looked up the same > way" or whatever, doesn't make them the same *kind* of attribute. To say > that all attributes are the same in python muddies the water. They are > the same in a generi

Re: Distinguishing attributes and methods

2007-12-09 Thread MonkeeSage
On Dec 8, 4:11 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > MonkeeSage a écrit : > > > > > On Dec 8, 12:56 pm, Bruno Desthuilliers > > <[EMAIL PROTECTED]> wrote: > > >>MonkeeSage a écrit : > > >>>On Dec 8, 2:10 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > On Fri, 07 Dec 2

Re: Distinguishing attributes and methods

2007-12-09 Thread Bruno Desthuilliers
Roy Smith a écrit : > In article <[EMAIL PROTECTED]>, > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > >>MonkeeSage a écrit : (snip) >>>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 obvi

Re: Distinguishing attributes and methods

2007-12-08 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > MonkeeSage a écrit : > > On Dec 8, 2:51 pm, Glenn Hutchings <[EMAIL PROTECTED]> wrote: > > > >>On Dec 8, 7:44 pm, MonkeeSage <[EMAIL PROTECTED]> wrote: > >> > >> > >>>I think it muddies the water to say that a.a() a

Re: Distinguishing attributes and methods

2007-12-08 Thread Bruno Desthuilliers
MonkeeSage a écrit : > On Dec 8, 2:51 pm, Glenn Hutchings <[EMAIL PROTECTED]> wrote: > >>On Dec 8, 7:44 pm, MonkeeSage <[EMAIL PROTECTED]> 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

Re: Distinguishing attributes and methods

2007-12-08 Thread Bruno Desthuilliers
MonkeeSage a écrit : > On Dec 8, 12:56 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > >>MonkeeSage a écrit : >> >> >> >> >>>On Dec 8, 2:10 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Fri, 07 Dec 2007 23:19:40 -0800, tjhnson wrote: >> >With properties, attributes a

Re: Distinguishing attributes and methods

2007-12-08 Thread MonkeeSage
On Dec 8, 2:51 pm, Glenn Hutchings <[EMAIL PROTECTED]> wrote: > On Dec 8, 7:44 pm, MonkeeSage <[EMAIL PROTECTED]> 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 t

Re: Distinguishing attributes and methods

2007-12-08 Thread Glenn Hutchings
On Dec 8, 7:44 pm, MonkeeSage <[EMAIL PROTECTED]> 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) -- http

Re: Distinguishing attributes and methods

2007-12-08 Thread Roberto Bonvallet
On Dec 8, 4:19 am, [EMAIL PROTECTED] 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 verbs, attributes are nouns :) -- Roberto Bonv

Re: Distinguishing attributes and methods

2007-12-08 Thread Marc 'BlackJack' Rintsch
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

Re: Distinguishing attributes and methods

2007-12-08 Thread MonkeeSage
On Dec 8, 12:56 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > MonkeeSage a écrit : > > > > > On Dec 8, 2:10 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > >>On Fri, 07 Dec 2007 23:19:40 -0800, tjhnson wrote: > > >>>With properties, attributes and methods seem very similar. I wa

Re: Distinguishing attributes and methods

2007-12-08 Thread Bruno Desthuilliers
MonkeeSage a écrit : > On Dec 8, 2:10 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> 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 >>>w

Re: Distinguishing attributes and methods

2007-12-08 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, > > 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. Documentation. > With ipython, I > use tab completion all the ti

Re: Distinguishing attributes and methods

2007-12-08 Thread MonkeeSage
On Dec 8, 6:50 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Sat, 08 Dec 2007 00:34:06 -0800, MonkeeSage wrote: > > I think he means callable attributes (methods) and non-callable > > attributes (variables). > > But not every callable attribute is a method. > > Ciao, > Marc '

Re: Distinguishing attributes and methods

2007-12-08 Thread Marc 'BlackJack' Rintsch
On Sat, 08 Dec 2007 00:34:06 -0800, MonkeeSage wrote: > I think he means callable attributes (methods) and non-callable > attributes (variables). But not every callable attribute is a method. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Distinguishing attributes and methods

2007-12-08 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hi, > > 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. With ipython, I > use tab completion all the time, but I can rarely t

Re: Distinguishing attributes and methods

2007-12-08 Thread MonkeeSage
On Dec 8, 2:10 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> 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

Re: Distinguishing attributes and methods

2007-12-08 Thread Marc 'BlackJack' Rintsch
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 --

Distinguishing attributes and methods

2007-12-07 Thread tjhnson
Hi, 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. With ipython, I use tab completion all the time, but I can rarely tell from the names alone whether it i