Tutorial by Examples

There are two different types of descriptors. Data descriptors are defined as objects that define both a __get__() and a __set__() method, whereas non-data descriptors only define a __get__() method. This distinction is important when considering overrides and the namespace of an instance's dictiona...
Descriptor objects can allow related object attributes to react to changes automatically. Suppose we want to model an oscillator with a given frequency (in Hertz) and period (in seconds). When we update the frequency we want the period to update, and when we update the period we want the frequency ...

Page 1 of 1