Skip to content

Instantly share code, notes, and snippets.

@salexkidd
Last active August 29, 2015 14:15
Show Gist options
  • Save salexkidd/88d95e9b02de6667a8eb to your computer and use it in GitHub Desktop.
Save salexkidd/88d95e9b02de6667a8eb to your computer and use it in GitHub Desktop.
Python decorator test
def test_decorator(func):
print("now test_decorator")
def _wrapper(dl):
print("now _wapper func")
dl.remove(5)
func(dl)
return _wrapper
@test_decorator
def test_func(data_list):
print(data_list)
if __name__ == "__main__":
data_list = range(1, 11)
test_func(data_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment