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...




Mon 12 June 2017

Generators in Python

Posted by marodrig in blog   

Generators help us be more memory efficient when working with collections in Python. We'll go over the different ways generators can be implemented, and some best practices.

Read more...