Dynamically reference variable in object

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Mar 26 19:42:22 EDT 2014


On Wed, 26 Mar 2014 15:19:03 -0600, Ian Kelly wrote:

> You want to access object "attributes", not "variables".

In fairness to the OP, the terminology "instance variables" meaning 
attributes or members of an instance is (sadly, in my opinion) common in 
some other languages, such as Java, and occasionally creeps into even the 
Python docs.

I've often ranted about this, and won't repeat it now, only point out 
that the preferred and most common terminology in Python circles is 
"attribute", or "instance attribute" if you need to distinguish it from 
"class attribute".



-- 
Steven D'Aprano
http://import-that.dreamwidth.org/



More information about the Python-list mailing list