Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Pass arguments along in cached decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Nov 11, 2020
1 parent 3f04a50 commit f7c1b7e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/sage/misc/cachefunc.pyx
Expand Up @@ -1243,8 +1243,8 @@ cdef class CachedFunction(object):
for ((args,kwargs), val) in P(arglist2):
self.set_cache(val, *args, **kwargs)

def cached_function(func):
return decorate(func, CachedFunction(func))
def cached_function(func, *, classmethod=False, name=None, key=None, do_pickle=None):
return decorate(func, CachedFunction(func, classmethod, name, key, do_pickle))


cdef class WeakCachedFunction(CachedFunction):
Expand Down Expand Up @@ -1433,8 +1433,8 @@ cdef class WeakCachedFunction(CachedFunction):
self.cache = CachedWeakValueDictionary(**kwds)


def weak_cached_function(func):
return decorate(func, WeakCachedFunction(func))
def weak_cached_function(func, *, classmethod=False, name=None, key=None, **kwds):
return decorate(func, WeakCachedFunction(func, classmethod, name, key, kwds))

class CachedMethodPickle(object):
"""
Expand Down Expand Up @@ -3304,8 +3304,8 @@ cdef class CachedInParentMethod(CachedMethod):
pass
return Caller

def cached_in_parent_method(func):
return decorate(func, CachedInParentMethod(func))
def cached_in_parent_method(func, name=None, key=None, do_pickle=None):
return decorate(func, CachedInParentMethod(func, name, key, do_pickle))


class FileCache(object):
Expand Down

0 comments on commit f7c1b7e

Please sign in to comment.