Message392643
That was anecdotal evidence:
```
Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:10:52)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def func(arg=1, *, kwarg=2): pass
...
>>> import functools
>>> from functools import lru_cache, update_wrapper
>>> @lru_cache
... def cached_func(arg=1, *, kwargs=2): pass
...
>>> def x(*args, **kwargs): func(*args, **kwargs)
...
>>> updated_x = update_wrapper(func, x)
>>> x
<function x at 0x7feff5892b80>
>>> updated_x
<function x at 0x7feff5828a60>
>>> updated_x.__defaults__
(1,)
>>> updated_x.__kwdefaults__
{'kwarg': 2}
>>> func.__defaults__
(1,)
>>> func.__kwdefaults__
{'kwarg': 2}
>>> cached_func.__defaults__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'functools._lru_cache_wrapper' object has no attribute '__defaults__'
>>> cached_func.__kwdefaults__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'functools._lru_cache_wrapper' object has no attribute '__kwdefaults__'
``` |
|
Date |
User |
Action |
Args |
2021-05-01 23:52:06 | gregory.p.smith | set | recipients:
+ gregory.p.smith, serhiy.storchaka |
2021-05-01 23:52:06 | gregory.p.smith | set | messageid: <1619913126.24.0.371979011955.issue44003@roundup.psfhosted.org> |
2021-05-01 23:52:06 | gregory.p.smith | link | issue44003 messages |
2021-05-01 23:52:06 | gregory.p.smith | create | |
|