[Python-Dev] Issue10403 - using 'attributes' instead of members in documentation

Michael Foord fuzzyman at voidspace.org.uk
Mon Jun 27 16:27:12 CEST 2011

On 27/06/2011 15:08, R. David Murray wrote:
> On Mon, 27 Jun 2011 09:47:05 +0100, Paul Moore<p.f.moore at gmail.com>  wrote:
>> On 27 June 2011 09:24, Antoine Pitrou<solipsis at 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 surprised if we start refer to methods as "attributes".
>> +1
>>> FWIW, I tend to understand "members" as "methods + attributes", which makes
>>> it a nice term to use for that purpose.
>> +1
> 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
> word things when both are being discussed, the existence in the language
> of getattr, setattr, and related methods argues against using the term
> 'members'.
> '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 Python is that the latter can be called and the
> former can't.  But even that is not an accurate distinction, since a
> 'data attribute' could, in fact, return a callable.
> 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,
> whereas getattr and setattr are evidence that the language considers
> them all attributes.  I think we do the documentation readers a
> disservice by obscuring that fact by using other terminology.

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 
(data-descriptors and non data-descriptors is terminology used in the 
documentation there).

If you're saying that data attributes isn't clear either (I couldn't 
quite tell from your email) then how *do* we draw a distinction. We 
could talk about instance attributes, non-descriptor class attributes 
and descriptors, but that terminology requires a reasonably advanced 
understanding of the Python data model.

I don't think that "all members, made up of attributes plus methods" is 
hard to understand. That's a great benefit. The fact that you can 
technically treat methods as attributes too is a minor detail.

All the best,

Michael Foord

> --
> R. David Murray           http://www.bitdance.com
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk


May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html

More information about the Python-Dev mailing list