Python decorators seem to confuse most newbies. But in reality they are just a fancy way of wrapping functions and modifying their behaviour as a consequence. They are functionally similar to Java annotations.
The code below describes a decorator in its simplest form.
It can be rewritten as per below, using the pie syntax:
No comments:
Post a Comment