May 2018
Intermediate to advanced
380 pages
9h 37m
English
With all the functionality that decorators provide, and their common use among Python packages, it's inevitable that someone would create a package just for decorators. https://pypi.python.org/pypi/decorator provides a pip installable package to help when working with decorators.
The decorator module is a very stable (more than 10 years old) tool that provides the ability to preserve decorated functions across different Python versions. The aim of the module is to simplify decorator usage, reduce boilerplate code, and enhance program readability and maintainability.
Decorators can be broken down into two main types: signature-preserving and signature-changing. The preserving decorators take a function call and ...