Last active
August 29, 2015 14:15
-
-
Save salexkidd/88d95e9b02de6667a8eb to your computer and use it in GitHub Desktop.
Python decorator test
This file contains 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 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