On Tue, Jun 28, 2011 at 10:30:14AM +1000, Nick Coghlan wrote:
Rather than fighting that convention, we should probably just confront
the ambiguity head on and update
http://docs.python.org/dev/glossary.html#term-attribute to describe
both uses of the term (and add a separate entry for data
On Tue, Jun 28, 2011 at 3:05 PM, Ben Finney ben+pyt...@benfinney.id.au wrote:
I still don't have a good term for “non-callable attribute”, though.
The two terms I've got out of this thread are callable attributes
(instance/static/class methods, etc) and data attributes (everything
else). Both
On Tue, Jun 28, 2011 at 2:33 AM, Nick Coghlan ncogh...@gmail.com wrote:
The two terms I've got out of this thread are callable attributes
(instance/static/class methods, etc) and data attributes (everything
else). Both seem reasonable to me, creating two largely disjoint sets
that together
On 28/06/2011 11:44, Fred Drake wrote:
On Tue, Jun 28, 2011 at 2:33 AM, Nick Coghlanncogh...@gmail.com wrote:
The two terms I've got out of this thread are callable attributes
(instance/static/class methods, etc) and data attributes (everything
else). Both seem reasonable to me, creating two
On Tue, Jun 28, 2011 at 6:54 AM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
Added to which there are other descriptors, notably property, that are not
directly callable but are not provided as normal data attributes (although
the access syntax is the same). Properties are much closer to
On 28/06/2011 12:04, Fred Drake wrote:
On Tue, Jun 28, 2011 at 6:54 AM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
Added to which there are other descriptors, notably property, that are not
directly callable but are not provided as normal data attributes (although
the access syntax is the
On Tue, 28 Jun 2011 11:54:39 +0100, Michael Foord fuzzy...@voidspace.org.uk
wrote:
On 28/06/2011 11:44, Fred Drake wrote:
But callable attributes aren't the same thing as methods; most are
methods,
but not all. Sometimes, they're data used by the object. The fact that
data attributes
On 28/06/2011 12:51, R. David Murray wrote:
On Tue, 28 Jun 2011 11:54:39 +0100, Michael Foordfuzzy...@voidspace.org.uk
wrote:
On 28/06/2011 11:44, Fred Drake wrote:
But callable attributes aren't the same thing as methods; most are methods,
but not all. Sometimes, they're data used by the
On Tue, Jun 28, 2011 at 8:54 PM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
The problem with data attributes is that it doesn't mean *anything*, which
I suppose is useful for invented terminology, but it means it doesn't convey
anything precise to those who haven't heard the term before. If
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 06/28/2011 06:44 AM, Fred Drake wrote:
On Tue, Jun 28, 2011 at 2:33 AM, Nick Coghlan ncogh...@gmail.com wrote:
The two terms I've got out of this thread are callable attributes
(instance/static/class methods, etc) and data attributes (everything
On 28/06/2011 13:31, Nick Coghlan wrote:
On Tue, Jun 28, 2011 at 8:54 PM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
The problem with data attributes is that it doesn't mean *anything*, which
I suppose is useful for invented terminology, but it means it doesn't convey
anything precise to
Michael Foord wrote:
What do you mean by instances can have methods as instance attributes?
Once you attach a bound method directly to an instance it becomes a
slightly different beast I think. (On top of which that is pretty rare
behaviour.)
class C:
... def method(self, x):
...
On 28/06/2011 13:56, Michael Foord wrote:
On 28/06/2011 13:31, Nick Coghlan wrote:
On Tue, Jun 28, 2011 at 8:54 PM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
The problem with data attributes is that it doesn't mean
*anything*, which
I suppose is useful for invented terminology, but it
On 28/06/2011 14:20, Steven D'Aprano wrote:
Michael Foord wrote:
What do you mean by instances can have methods as instance
attributes? Once you attach a bound method directly to an instance
it becomes a slightly different beast I think. (On top of which that
is pretty rare behaviour.)
On Tue, Jun 28, 2011 at 10:56 PM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
I don't think data attributes is clear or precise. Is a property a data
attribute (well it depends how it is implemented and what it does), is a
staticmethod a data attribute (no - but then Tres' question - it
On Tue, Jun 28, 2011 at 11:27 PM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
Technically also via __getattribute__ when overridden.
Since object.__getattribute__ is the hook that implements the entire
attribute lookup protocol, *all* attributes are technically retrieved
via __getattribute__
On 6/28/2011 7:51 AM, R. David Murray wrote:
Also, instances can have methods as instance attributes.
Functions that are instance attributes do not act like methods
(instance.func() does not automagically turn instance in the first arg
of func) and have never, to my knowledge, been called
On Tue, Jun 28, 2011 at 5:35 AM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
Well, they're *usually* implemented as methods and backed by a real instance
attribute. Usually (but not always) it makes more sense (IME) to group them
with methods. The fact that they're *accessed* as an
On 28/06/2011 16:23, Terry Reedy wrote:
On 6/28/2011 7:51 AM, R. David Murray wrote:
Also, instances can have methods as instance attributes.
Functions that are instance attributes do not act like methods
(instance.func() does not automagically turn instance in the first arg
of func) and
On Tue, Jun 28, 2011 at 7:20 AM, Steven D'Aprano st...@pearwood.info wrote:
Michael Foord wrote:
What do you mean by instances can have methods as instance attributes?
Once you attach a bound method directly to an instance it becomes a slightly
different beast I think. (On top of which that
On 6/28/2011 9:20 AM, Steven D'Aprano wrote:
class C:
... def method(self, x):
... return x+1
...
c = C()
c.method = types.MethodType(lambda self, x: x+101, c)
types.MethodType creates a bound method, not a method. A bound method is
a partial or curried function, which is to say, a
On 6/28/2011 11:35 AM, Michael Foord wrote:
On 28/06/2011 16:23, Terry Reedy wrote:
So-called 'staticmethods' are not really methods either, but are class
function attributes that are just functions and not treated as
methods. The decorator that negates normal method treatment
could/should
On Tue, Jun 28, 2011 at 06:28, Nick Coghlan ncogh...@gmail.com wrote:
On Tue, Jun 28, 2011 at 10:56 PM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
I don't think data attributes is clear or precise. Is a property a data
attribute (well it depends how it is implemented and what it does),
Le Mon, 27 Jun 2011 11:32:32 +1000,
Nick Coghlan ncogh...@gmail.com a écrit :
On Mon, Jun 27, 2011 at 7:52 AM, Terry Reedy tjre...@udel.edu wrote:
or the 'attribute' substitution everywhere makes sense?
No.
My strong history-based opinions ;-).
+1 to what Terry said.
Members is a
On 27 June 2011 09:24, Antoine Pitrou solip...@pitrou.net wrote:
While I know it is technically right, I find it a bit strange to refer to
methods as attributes. We're describing an API, not the inner working of
the object model. Also, people just discovering Python will probably be a
bit
On 27/06/2011 09:24, Antoine Pitrou wrote:
Le Mon, 27 Jun 2011 11:32:32 +1000,
Nick Coghlanncogh...@gmail.com a écrit :
On Mon, Jun 27, 2011 at 7:52 AM, Terry Reedytjre...@udel.edu wrote:
or the 'attribute' substitution everywhere makes sense?
No.
My strong history-based opinions ;-).
+1
On Mon, Jun 27, 2011 at 10:24:28AM +0200, Antoine Pitrou wrote:
FWIW, I tend to understand members as methods + attributes, which makes
it a nice term to use for that purpose.
That's my feeling too.
Oleg.
--
Oleg Broytmanhttp://phdru.name/p...@phdru.name
On Mon, 27 Jun 2011 09:47:05 +0100, Paul Moore p.f.mo...@gmail.com wrote:
On 27 June 2011 09:24, Antoine Pitrou solip...@pitrou.net wrote:
While I know it is technically right, I find it a bit strange to refer to
methods as attributes. We're describing an API, not the inner working of
the
On 27/06/2011 15:08, R. David Murray wrote:
Wow, all these people who like 'members', and I can't think of ever
using that term in a Python context.
While I agree that using 'attribute' when only methods are being discussed
would most likely be confusing, and that it can be tricky to clearly
On 27/06/2011 15:08, R. David Murray wrote:
On Mon, 27 Jun 2011 09:47:05 +0100, Paul Moorep.f.mo...@gmail.com wrote:
On 27 June 2011 09:24, Antoine Pitrousolip...@pitrou.net wrote:
While I know it is technically right, I find it a bit strange to refer to
methods as attributes. We're
On Tue, Jun 28, 2011 at 12:08 AM, R. David Murray rdmur...@bitdance.com wrote:
While I agree that using 'attribute' when only methods are being discussed
would most likely be confusing, and that it can be tricky to clearly
word things when both are being discussed, the existence in the language
On Tue, Jun 28, 2011 at 12:27 AM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
Well perhaps, but where does the language draw the distinction between
attributes and data attributes as you all them (a term entirely new to
me)? Only in the descriptor protocol and that term isn't used there
Nick Coghlan writes:
And no, the fact that methods can be treated as attributes is not a
minor detail. It is *fundamental* to Python's object model that
*methods are not a special case of attribute access*.
That's ambiguous. I assume you mean just a case of attribute access,
and not
Nick Coghlan ncogh...@gmail.com wrote:
And no, the fact that methods can be treated as attributes is not a
minor detail. It is *fundamental* to Python's object model that
*methods are not a special case of attribute access*. All attributes
work the same way, it is just the way functions
On Mon, 27 Jun 2011 15:27:12 +0100, Michael Foord fuzzy...@voidspace.org.uk
wrote:
On 27/06/2011 15:08, R. David Murray wrote:
'data attributes' can so easily become something else in Python...it
seems to me that the only real difference between 'data attributes' and
'method attributes' in
Egads.
Back when I wrote
Members and methods should just be attributes.
I used quotes to specifically indicate that this applied to the phrase
members and methods, not their separate use. I guess I wasn't obvious
enough.
The general Python-historical uses of members is unfortunate.
My
Le Tue, 28 Jun 2011 00:36:20 +1000,
Nick Coghlan ncogh...@gmail.com a écrit :
And no, the fact that methods can be treated as attributes is not a
minor detail. It is *fundamental* to Python's object model that
*methods are not a special case of attribute access*.
Uh, and so what?
Again, the
On 6/27/2011 4:24 AM, Antoine Pitrou wrote:
Le Mon, 27 Jun 2011 11:32:32 +1000,
Nick Coghlanncogh...@gmail.com a écrit :
Members is a historical relic that is best replaced by attributes
or data attributes if we want to explicitly exclude methods for some
reason. Methods is a subset of
On Mon, 27 Jun 2011 19:27:26 +0200, Antoine Pitrou solip...@pitrou.net wrote:
Le Tue, 28 Jun 2011 00:36:20 +1000,
Nick Coghlan ncogh...@gmail.com a écrit :
And no, the fact that methods can be treated as attributes is not a
minor detail. It is *fundamental* to Python's object model that
On 27/06/2011 20:22, R. David Murray wrote:
[snip...]
So, the correct generic term for something that can be accessed
via attribute notation is attribute. The more specific term for an
attribute that is a method is method. We don't currently have a more
specific collective term for attributes
On Mon, 27 Jun 2011 20:30:12 +0100, Michael Foord fuzzy...@voidspace.org.uk
wrote:
On 27/06/2011 20:22, R. David Murray wrote:
[snip...]
So, the correct generic term for something that can be accessed
via attribute notation is attribute. The more specific term for an
attribute that is a
On 6/27/2011 5:42 AM, Michael Foord wrote:
On 27/06/2011 09:24, Antoine Pitrou wrote:
FWIW, I tend to understand members as methods + attributes, which
makes
it a nice term to use for that purpose.
That is my understanding / use of the terms as well.
On 6/27/2011 5:45 AM, Oleg Broytman
On 6/27/2011 2:33 PM, Terry Reedy wrote:
Let me repeat that that is historically wrong for Python, and illustrate
why the term 'members' should not be used. From the 1.5 Language
Reference, 3.2 Standard type hierarchy: There are also some 'generic'
special attributes, not listed with the
On 27/06/2011 23:18, Terry Reedy wrote:
On 6/27/2011 2:33 PM, Terry Reedy wrote:
Let me repeat that that is historically wrong for Python, and illustrate
why the term 'members' should not be used. From the 1.5 Language
Reference, 3.2 Standard type hierarchy: There are also some 'generic'
R. David Murray wrote:
So, the correct generic term for something that can be accessed
via attribute notation is attribute. The more specific term for an
attribute that is a method is method. We don't currently have a more
specific collective term for attributes that aren't methods. *That*
On Tue, Jun 28, 2011 at 8:46 AM, Michael Foord
fuzzy...@voidspace.org.uk wrote:
So the Python 2.2 what's new talks about attributes and methods as different
things Of course the context makes it clear, but this mirrors how I use
the terms in discussion and how I see others generally using
Rob Cliffe rob.cli...@btinternet.com writes:
On 27/06/2011 15:08, R. David Murray wrote:
I guess what I'm saying is that I am more comfortable calling them
all attributes than calling them all members. The term 'members'
isn't used anywhere in the language itself, as far as I can recall,
On Mon, Jun 27, 2011 at 8:11 PM, Ben Finney ben+pyt...@benfinney.id.au wrote:
Rob Cliffe rob.cli...@btinternet.com writes:
'function attributes' ? 'def attributes' ?
-1. They don't have to be functions, and hence don't have to be created
by 'def'.
Or just stick with method attributes' ?
Eric Snow ericsnowcurren...@gmail.com writes:
On Mon, Jun 27, 2011 at 8:11 PM, Ben Finney ben+pyt...@benfinney.id.au
wrote:
callable attributes describes exactly what they are, in terms that
will remain useful to the person learning Python.
The usage of the object determines what we call
Hello!
http://bugs.python.org/issue10403 is a documentation bug which talks
about using the term 'attribute' instead of the term 'member' when it
denotes the class attributes. Agreed.
But the discussion goes on to mention that,
Members and methods should just be attributes.
I find this bit
On 6/26/2011 2:52 PM, Senthil Kumaran wrote:
http://bugs.python.org/issue10403 is a documentation bug which talks
about using the term 'attribute' instead of the term 'member' when it
denotes the class attributes. Agreed.
But the discussion goes on to mention that,
Members and methods should
On Mon, Jun 27, 2011 at 7:52 AM, Terry Reedy tjre...@udel.edu wrote:
or the 'attribute' substitution everywhere makes sense?
No.
My strong history-based opinions ;-).
+1 to what Terry said.
Members is a historical relic that is best replaced by attributes
or data attributes if we want to
52 matches
Mail list logo