[Python-Dev] Issue10403 - using 'attributes' instead of members in documentation
ericsnowcurrently at gmail.com
Tue Jun 28 17:35:01 CEST 2011
On Tue, Jun 28, 2011 at 5:35 AM, Michael Foord
<fuzzyman at 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 attribute is the
> uninteresting detail.
> __getattr__ and __getattribute__ are interesting - they allow you to use
> attribute access syntax for things that *aren't* attributes.
> I appreciate the fact that the Python data-model means methods are just
> object attributes, but they're not *instance attributes* and sometimes you
> need to make a distinction. (And yes it is helpful if the standard
> terminology leads people into a better understanding of the Python data
> model, but that still doesn't change the need on occasion for terminology
> that doesn't need to be explained whenever it is used.)
While the distinction between class-specific attributes and
instance-specific is important, I don't think merging it with the
method/data distinction is as helpful. The valuable information here
is the expectation of how the attributes are used. In my mind, that
boils down to data (holds static or dymanic state) and methods (does
something on the class or instance).
> Given that how even methods are to be described depends on the context (if
> you're fetching bound methods as objects then it makes perfect sense to just
> talk about them as attributes) it doesn't seem an area amenable to
> one-size-fits-all terminology.
>>> The problem with "data attributes" is that it doesn't mean *anything*,
>>> I suppose is useful for invented terminology, but it means it doesn't
>>> anything precise to those who haven't heard the term before. If it
>>> widely used then that changes I guess. I'd still normally just use
>>> "attributes" though...
>> I'd read "data attributes" the same as "non-method attributes". For
>> calling them "attributes" is typically sufficient. It's rare to need to
>> distinguish them from methods.
> Yeah, this is all a grand bikeshed. I'm not sure I would understand "data
> attributes" unless it was clear from the context. I would wonder what
> qualifies something as "data".
> It is an interesting question what terminology we should use in the
> documentation if we need to distinguish them, but I think that is still
> wandering away from the original question that was posed.
> All the best,
> 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
> Python-Dev mailing list
> Python-Dev at python.org
More information about the Python-Dev