Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

You can use lru_cache(maxsize=128, typed=False)(user_function). lru_cache 
should support a function as an argument on if it is a single positional 
argument, this is the purpose. So you can write

@lru_cache
def func(...):
    ...

instead of

@lru_cache()
def func(...):
    ...

When you pass maxsize and typed you do not pass a function as an argument of 
lru_cache, you pass it as an argument of the decorator created by the 
lru_cache() call.

@lru_cache(maxsize=128, typed=False)
def func(...):
    ...

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40114>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to