December 2018
Intermediate to advanced
240 pages
5h 41m
English

Python’s decorators are a handy way to modify functions. Decorators were first introduced in Python 2.2, with the classmethod() and staticmethod() decorators, but were overhauled to become more flexible and readable. Along with these two original decorators, Python now provides a few right out of the box and supports the simple creation of custom decorators. But it seems as though most developers do not understand how they work behind the scenes.
This chapter aims to change that—we’ll cover what a decorator is and how to use it, as well as how to create your own decorators. Then we’ll look at using decorators to create ...
Read now
Unlock full access