new slicing done and first attempts at copy and pickling full models

This commit is contained in:
Max Zwiessele 2014-03-27 09:28:44 +00:00
parent c65a1e3544
commit e26e737014
2 changed files with 103 additions and 86 deletions

View file

@ -101,7 +101,7 @@ class Cacher(object):
def __name__(self):
return self.operation.__name__
from functools import partial
from functools import partial, update_wrapper
class Cacher_wrap(object):
def __init__(self, f, limit, ignore_args, force_kwargs):
@ -109,6 +109,7 @@ class Cacher_wrap(object):
self.ignore_args = ignore_args
self.force_kwargs = force_kwargs
self.f = f
update_wrapper(self, self.f)
def __get__(self, obj, objtype=None):
return partial(self, obj)
def __call__(self, *args, **kwargs):