Skip to content

Instantly share code, notes, and snippets.

@yriveiro
Created May 23, 2013 17:04
Show Gist options
  • Save yriveiro/5637655 to your computer and use it in GitHub Desktop.
Save yriveiro/5637655 to your computer and use it in GitHub Desktop.
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