Skip to content

Instantly share code, notes, and snippets.

@timofurrer
Created October 14, 2016 10:08
Show Gist options
  • Save timofurrer/a4606b90930983706afd8e1ed579918b to your computer and use it in GitHub Desktop.
Save timofurrer/a4606b90930983706afd8e1ed579918b to your computer and use it in GitHub Desktop.
null created by timofurrer - https://repl.it/DwHZ/0
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