The Ultimate Guide to Python Decorators, Part I: Function Registration

1 · Miguel Grinberg · June 4, 2019, 3:49 p.m.
One of the signatures of the Flask framework is its clever use of decorators for common application tasks such as defining routes and error handlers. Decorators give a very concise and readable structure to your code, so much that most Flask extensions and many other Python packages follow the same pattern and expose core parts of their functionality through decorators. Today I'm starting a series of in-depth posts about different ways in which you can incorporate custom decorators into your Pyt...