Re:OK, here's the thing: this is only the entrance of the ra...
by bad_user on Tuesday October 19, 2010 @05:07AM
(#1806573)
Python has it in a more object-oriented way ...
Where "getattr" is just a pretty protocol for calling ...
This extends to whatever you want, including members of namespaces (like declared classes, functions, other namespaces, etc...)
[ Parent
| on HN ]
Re:OK, here's the thing: this is only the entrance of the ra...
by hagy on Tuesday October 19, 2010 @06:10AM
(#1806665)
There is actually a little more to getattr in that __dict__ just has attributes local to that instance where as getattr (also instance.attribute syntax) also accesses class attributes, non-bound methods, and properties. Additionally, these non-local attributes can also be inherited from parent classes.