[Python-Dev] Issue10403 - using 'attributes' instead of members in documentation
Nick Coghlan
ncoghlan at gmail.com
Mon Jun 27 16:36:20 CEST 2011
On Tue, Jun 28, 2011 at 12:27 AM, Michael Foord
<fuzzyman at 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
> (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.
It has almost no precedent in the Python context and what precedent it
does have is wrong (since it excluded methods).
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 implement the
descriptor protocol that makes instance methods behave the way they
do.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list