Jelle Zijlstra <jelle.zijls...@gmail.com> added the comment:
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' ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41232> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com