Advertisement
lessientelrunya

Untitled

Apr 6th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. a_stand_alone_function = my_shiny_new_decorator(a_stand_alone_function)
  2. a_stand_alone_function()
  3. #outputs:
  4. #Before the function runs
  5. #I am a stand alone function, don't you dare modify me
  6. #After the function runs
  7.  
  8. # That’s EXACTLY what decorators do!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement