Attribute reference design

Diez B. Roggisch deets at nospam.web.de
Tue Jul 1 17:24:02 EDT 2008


chamalulu schrieb:
> Hello.
> I think I'm aware of how attribute access is resolved in python. When
> referencing a class instance attribute which is not defined in the
> scope of the instance, Python looks for a class attribute with the
> same name. (For assignment or deletion this is not the case,
> thankfully.)
> I've been trying to understand why? What is the reason behind, or
> practical purpose of, this design decision? Anyone, please enlighten
> me.

How else would you resolve methods which are of course defined on the 
class but invoked through the instance?

Diez



More information about the Python-list mailing list