Am 16.12.2011 09:52 schrieb Ulrich:

Could anyone please explain me why this does not work / how to get b
into .__dict__ / hint me to an explanation?

b is not a data element of the particular instance, but it lives in the class. It is, roughly spoken, a "kind of method", just to be used without calling. These things are called "data descriptors" (http://docs.python.org/reference/datamodel.html#descriptors).

t.b is internally reflected to te.__dict__['b'].__get__(t, te) in order to call the __get__ method of the property object. This is done on every call and the value is, in your case, derived from the instance value a.

HTH,

Thomas
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to