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 gregory.p.smith
Recipients Thor Whalen, Thor Whalen2, domdfcoding, donovick, gregory.p.smith, ncoghlan, terry.reedy
Date 2021-05-02.01:03:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619917439.19.0.750855080279.issue41232@roundup.psfhosted.org>
In-reply-to
Content
I'm working on a more specialized case of this for functools.lru_cache in bpo-issue44003.  But I believe this issue also makes sense.  It is basically suggesting that __defaults__ and __kwdefaults__ should be included in the default set of assigned= attributes that functools.update_wrapper applies.

The argument in favor of this is that it already has __annotations__ in the default set.  With that, the default isn't really correct for use on any decorator that modifies the meaning or overall call signature of the function if it happens to have annotations.  as __annotations__ and __defaults__ and __kwdefaults__ are all abstract callable introspection interfaces.

From Python's perspective some may call each of these an Enhancement rather than a Bugfix.  I'm fine with that.  It doesn't come up super often but would make Python things more consistent if it were done.

Your PR makes sense to me, though we'll need to understand and fix that test failure you identified where it appears to be potentially testing for the wrong thing (I haven't studied it enough study to say yet).
History
Date User Action Args
2021-05-02 01:03:59gregory.p.smithsetrecipients: + gregory.p.smith, terry.reedy, ncoghlan, donovick, Thor Whalen, Thor Whalen2, domdfcoding
2021-05-02 01:03:59gregory.p.smithsetmessageid: <1619917439.19.0.750855080279.issue41232@roundup.psfhosted.org>
2021-05-02 01:03:59gregory.p.smithlinkissue41232 messages
2021-05-02 01:03:58gregory.p.smithcreate