This is the material for SANS Webcast where we deep dive into the internals of how Python Decorators work. To understand this material you will want to watch the associated presentation.
The registration link is here: https://www.sans.org/webcasts/python-decorators-demystified-108900
(update) The talk has been archived here : https://www.youtube.com/watch?v=M4FrdJKGwX4&t=1981s