Created
October 14, 2016 10:08
-
-
Save timofurrer/a4606b90930983706afd8e1ed579918b to your computer and use it in GitHub Desktop.
null created by timofurrer - https://repl.it/DwHZ/0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo(f): | |
print("Foo is called") | |
def _wrapper(): | |
print("Foo wrapper is called") | |
f() | |
return _wrapper | |
def bar(f): | |
print("Bar is called") | |
def _wrapper(): | |
print("Bar wrapper is called") | |
f() | |
return _wrapper | |
print("=== During import ===") | |
@foo | |
@bar | |
def michi(): | |
print("Michi is called") | |
print("=== After import ===") | |
print("=== During function execution") | |
michi() | |
print("=== After function execution") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment