Created
August 27, 2019 17:53
-
-
Save brydavis/0b8d4ed47d75fcf26617c1a5c91443aa to your computer and use it in GitHub Desktop.
Examples of creating and using decorators in Python
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notice that in the last example, we are NOT using decorators and yet achieve the same result.
In fact, we are using a couple of simple functions and a closure.
Like many features in Python, decorators may not always provide the simplest (or even Pythonic) way to write code.
Use wisely.