
On Mon, 27 Jun 2011 09:47:05 +0100, Paul Moore <p.f.moore@gmail.com> wrote:
On 27 June 2011 09:24, Antoine Pitrou <solipsis@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. -- R. David Murray http://www.bitdance.com