Created
August 21, 2016 21:16
-
-
Save vinay13/537847490358bfaf9163c49e2b179b40 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
#usr/bin/python | |
#Decorators | |
def decorator_func(original_function): | |
def wrapper_func(): | |
print('wrapper executed this before {}'.format(original_function.__name__)) | |
return original_function() | |
return wrapper_func | |
@decorator_func | |
def display(): | |
print('display function ran') | |
@decorator_func | |
def xyz_display(): | |
print('xyz display ran') | |
print dir(decorator_func) | |
display() | |
xyz_display() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment