Feature request: String-inferred names

Ben Finney ben+python at benfinney.id.au
Fri Dec 4 02:05:03 EST 2009


Brad Harms <fearsomedragonfly at gmail.com> writes:

> Anyway, it looks like the docs agree with you
> (http://docs.python.org/glossary.html#term-attribute), so I'm not
> going to argue.

That's good, because the terms are quite well established in Python
terminology.

> However, for the purpose of clean communication, I'd still like to
> have terms that refer specifically to:
>
> 1.) "Regular" attributes, ie. those that are shortcuts to items in the
> directly associated object's __dict__,

I don't know what you mean by “shortcuts to items”. The names are looked
up in dictionaries; where do shortcuts play a part?

Try “instance attribute”, as distinct from “class attribute”.

> 2.) Attributes whose values are determined or assigned dynamically by
> indirectly calling a function (like properties and instancemethods)

Yes, the term “property” seems to do what you want.

The value of an instance method is *not* determined dynamically: its
value is a function, and that value is no more dynamic than any other
attribute of the instance.

> 3.) Attributes that are read from an object with regular .dot syntax,
> but are actually attributes (in the sense of #1 above) of the __dict__
> of the object's class.

This is a “class attribute” as distinct from an “instance attribute”.

The distinction isn't often worth knowing, though, so you'll probably
still have to explain it when you use it.

-- 
 \          “‘Did you sleep well?’ ‘No, I made a couple of mistakes.’” |
  `\                                                    —Steven Wright |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list