Last active
April 14, 2020 07:34
-
-
Save shivankgtm/41f48384c7380d802729ba101c10ab82 to your computer and use it in GitHub Desktop.
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 decorator_for_print(function): | |
def print_args(*args): | |
print('GIVEN arguments are ', args) | |
return function(args) | |
return print_args | |
@decorator_for_print | |
def func(alist): | |
return alist | |
print(some_function([1,2,3,4,5,6])) # call the function. | |
# Output: | |
# GIVEN arguments are ([1, 2, 3, 4, 5, 6],) | |
# ([1, 2, 3, 4, 5, 6],) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment