Created
May 23, 2013 17:04
-
-
Save yriveiro/5637655 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import functools | |
class Foo(object): | |
def _cache(func): | |
@wraps(func) | |
def _cache_decorator(self, *args, **kwargs): | |
# Do stuff here | |
return func(self, *args, **kwargs) | |
return _cache_decorator | |
@_cache | |
def method(self, *args, **kwargs): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment