This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JelleZijlstra
Recipients JelleZijlstra, Thor Whalen, Thor Whalen2, domdfcoding, donovick, gregory.p.smith, ncoghlan, terry.reedy
Date 2021-05-02.03:52:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619927557.79.0.893728150137.issue41232@roundup.psfhosted.org>
In-reply-to
Content
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'
History
Date User Action Args
2021-05-02 03:52:37JelleZijlstrasetrecipients: + JelleZijlstra, terry.reedy, gregory.p.smith, ncoghlan, donovick, Thor Whalen, Thor Whalen2, domdfcoding
2021-05-02 03:52:37JelleZijlstrasetmessageid: <1619927557.79.0.893728150137.issue41232@roundup.psfhosted.org>
2021-05-02 03:52:37JelleZijlstralinkissue41232 messages
2021-05-02 03:52:37JelleZijlstracreate