Message392645
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) |
|
Date |
User |
Action |
Args |
2021-05-02 00:17:47 | rhettinger | set | recipients:
+ rhettinger, gregory.p.smith, serhiy.storchaka |
2021-05-02 00:17:47 | rhettinger | set | messageid: <1619914667.39.0.0831494961978.issue44003@roundup.psfhosted.org> |
2021-05-02 00:17:47 | rhettinger | link | issue44003 messages |
2021-05-02 00:17:47 | rhettinger | create | |
|