gh-124342: Wrap __annotate__ functions in functools.update_wrapper#124346
gh-124342: Wrap __annotate__ functions in functools.update_wrapper#124346JelleZijlstra wants to merge 2 commits into
Conversation
vstinner
left a comment
There was a problem hiding this comment.
LGTM.
I was just surprised that updating func.__annotations__ after update_wrapper(wrapper, func) doesn't update wrapper.__annotations__. Don't get me wrong, I'm fine with this behavior.
Sorry, something went wrong.
|
Another surprising behavior. I'm discovering When I update annotations of the wrapped function, I would expect getting the same value for both cases. Either |
Sorry, something went wrong.
|
This is because we use |
Sorry, something went wrong.
functools.update_wrapperimplementation #124342📚 Documentation preview 📚: https://cpython-previews--124346.org.readthedocs.build/