Raymond Hettinger <[email protected]> added the comment:
I don't think this should be done. We want the lru_cache to be a pass-through.
Applying defaults or keyword-only/positional-only restrictions is the
responsibility of the inner function.
FWIW, here are the fields that Nick selected to be included in
update_wrapper(): ('__module__', '__name__', '__qualname__', '__doc__',
'__annotations__').
Those are sufficient to get help() to work which is all we were aiming for:
>>> from functools import *
>>> @lru_cache
def cached_func(b=5):
pass
>>> help(cached_func)
Help on _lru_cache_wrapper in module __main__:
cached_func(b=5)
----------
nosy: +rhettinger
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue44003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com