Message392658
We should not do this, because the wrapping function may have different defaults, and updating __defaults__ would make it use the wrapped function's defaults.
Example:
>>> def f(y=1):
... print(y)
...
>>> f()
1
>>> f.__defaults__
(1,)
>>> f.__defaults__ = ()
>>> f()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: f() missing 1 required positional argument: 'y' |
|
Date |
User |
Action |
Args |
2021-05-02 03:52:37 | JelleZijlstra | set | recipients:
+ JelleZijlstra, terry.reedy, gregory.p.smith, ncoghlan, donovick, Thor Whalen, Thor Whalen2, domdfcoding |
2021-05-02 03:52:37 | JelleZijlstra | set | messageid: <1619927557.79.0.893728150137.issue41232@roundup.psfhosted.org> |
2021-05-02 03:52:37 | JelleZijlstra | link | issue41232 messages |
2021-05-02 03:52:37 | JelleZijlstra | create | |
|