Bits of Py.

If the implementation is hard to explain, it's a bad idea

Fri 10 August 2018

The descriptor protocol in Python

Posted by marodrig in blog   

The main advantage of descriptors is that they allow the developer to create managed attributes, protecting the attribute from changes or automatically updating if it has a dependency on other attribute. The descriptors protocol allows the developer to improve coding quality by implementing a pythonic implementation similar to getter and setter methods.

Read more...