Created
November 5, 2016 17:08
-
-
Save Kwpolska/ea0cf5a4c4d0e9620c07bde17abbe343 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
from functools import wraps | |
def dec(f): | |
@wraps(f) | |
def wrapper(i): | |
print("wrapper") | |
return f(i) | |
return wrapper | |
@dec | |
def fib(a): | |
print("fib", a) | |
if a == 0: return 1 | |
if a == 1: return 1 | |
return fib(a - 1) + fib(a - 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment