Decorating With Python: Using Python's Decorators With Functions and Methods
Saturday January 20, 2007
Since Python 2.2, methods and functions have been able to be referenced using Python's
staticmethod() and classmethod() methods. However, with Python 2.4, a new syntactic feature was introduced: the decorator. The use of the decorator is akin to pointers in C, symbolic links in Unix, and shortcuts in Windows. However, many programmers still have trouble comprehending the syntax and the benefit of decorators in Python programming. For this reason, I have put together a discussion of the syntax and purpose of decorators.