descriptor definition

a descriptor is an object attribute with “binding behavior”, one whose attribute access has been overridden by methods in the descriptor protocol.

added 2012-06-01T23:02:12Z by anders

non-data descriptor defnition

Descriptors that only define get are called non-data descriptors (they are typically used for methods but other uses are possible).

added 2012-06-01T23:02:12Z by anders

data descriptor definition

If an object defines both __get__ and __set__, it is considered a data descriptor.

added 2012-06-01T23:02:12Z by anders

descriptors are invoked by the __getattribute__ method

overriding __getattribute__ prevents automatic descriptor calls

added 2012-06-01T23:02:12Z by anders

descriptor precedence rules

If an instance’s dictionary has an entry with the same name as a data descriptor, the data descriptor takes precedence. If an instance’s dictionary has an entry with the same name as a non-data descriptor, the dictionary entry takes precedence.

added 2012-06-01T23:02:12Z by anders