Understanding Python Decorators

Python decorators seem to be one of those mysterious parts of python code that other people write, and you just use. Here, we’ll be building a simple, but useful decorator from scratch and adding new functionality step by step to try and gain a better understanding of how decorators work, and how they can be used. For reference, python wiki provides an excellent library of python decorator patterns, from which we will steal the Retry example.