Add update_wrapper and fix wraps handing of missing attrs#251
Merged
benjaminp merged 4 commits intobenjaminp:masterfrom Jan 7, 2020
Merged
Conversation
a45ac61 to
ae270b1
Compare
Contributor
Author
|
@benjaminp is there any chance of this getting accepted or at least reviewed sooner rather than later? |
Contributor
Author
|
@benjaminp gentle reminder about this fix. |
benjaminp
reviewed
Nov 5, 2019
documentation/index.rst
Outdated
| aliased to :class:`py3:object`.) | ||
|
|
||
|
|
||
| .. function:: update_wrapper(wrapper, wrapped, assigned=functools.WRAPPER_ASSIGNMENTS, updated=functools.WRAPPER_UPDATES) |
Contributor
Author
There was a problem hiding this comment.
This PR is about adding support for __wrapped__ attribute, and there are two functions that need to be backported to provide the missing attribute: update_wrapper and wraps (that uses update_wrapper internally).
That said, the most frequently used one is wraps, so we can make the backported update_wrapper internal if you like.
Owner
There was a problem hiding this comment.
I think it's always better to start out private.
immerrr
commented
Nov 5, 2019
6044165 to
83cc15c
Compare
Owner
|
looks like CI is failing |
83cc15c to
e2b5dac
Compare
Contributor
Author
|
Yeah, sorry, I missed the notification, should be fixed now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR should fix #250 and #165.
This is pretty-much a straight backport of Py3 implementations of
update_wrapperandwraps, which is probably the easier way, but let me know if adding an extra public functionupdate_wrappershould be avoided and this point and I'll fix it withinwrapsitself.