Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.9] bpo-45678: Fix singledispatchmethod classmethod/staticmethod bug#29394

Merged
ambv merged 3 commits into
python:3.9python/cpython:3.9from
AlexWaygood:singledispatchmethod-wrapping-bugAlexWaygood/cpython:singledispatchmethod-wrapping-bugCopy head branch name to clipboard
Nov 4, 2021
Merged

[3.9] bpo-45678: Fix singledispatchmethod classmethod/staticmethod bug#29394
ambv merged 3 commits into
python:3.9python/cpython:3.9from
AlexWaygood:singledispatchmethod-wrapping-bugAlexWaygood/cpython:singledispatchmethod-wrapping-bugCopy head branch name to clipboard

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Nov 3, 2021

Copy link
Copy Markdown
Member

This PR fixes a bug in the 3.9 branch where
functools.singledispatchmethod did not properly wrap attributes such as
__name__, __doc__ and __module__ of the target method. It also
backports tests already merged into the 3.11 and 3.10 branches in #29328 and
#29390.

https://bugs.python.org/issue45678

…od` bug

This PR fixes a bug in the 3.9 branch where
``functools.singledispatchmethod`` did not properly wrap attributes such as
``__name__``, ``__doc__`` and ``__module__`` of the target method. It also
backports tests already merged into the 3.11 and 3.10 branches in #python#29328 and
python#29390.
@AlexWaygood

Copy link
Copy Markdown
Member Author

To test this bugfix, I added some additional tests that were not included in #29328 and #29390 (the previous PRs to the 3.10 & 3.11 branches). I'd like to "forward-port" these tests to 3.10 & 3.11 after this PR is merged (if it is accepted), before the BPO issue is closed.

Comment thread Lib/functools.py Outdated
@ambv ambv merged commit effb72f into python:3.9 Nov 4, 2021
@ambv

ambv commented Nov 4, 2021

Copy link
Copy Markdown
Contributor

Go ahead and "forward-port" the new tests, @AlexWaygood!

@AlexWaygood AlexWaygood deleted the singledispatchmethod-wrapping-bug branch November 4, 2021 19:55
AlexWaygood added a commit to AlexWaygood/cpython that referenced this pull request Nov 4, 2021
In order to fix a bug in the 3.9 branch in python#29394, more tests were added to
``test_functools.py`` to ensure that ``singledispatchmethod`` still correctly
wrapped a target method, even if the target method had already been wrapped by
 multiple other decorators. This PR brings the new tests into the 3.11 and 3.10
branches as well.
@AlexWaygood

Copy link
Copy Markdown
Member Author

Go ahead and "forward-port" the new tests, @AlexWaygood!

Forward-port is here! #29412 😀

ambv pushed a commit that referenced this pull request Nov 5, 2021
In order to fix a bug in the 3.9 branch in #29394, more tests were added to
``test_functools.py`` to ensure that ``singledispatchmethod`` still correctly
wrapped a target method, even if the target method had already been wrapped by
 multiple other decorators. This PR brings the new tests into the 3.11 and 3.10
branches as well.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 5, 2021
In order to fix a bug in the 3.9 branch in pythonGH-29394, more tests were added to
``test_functools.py`` to ensure that ``singledispatchmethod`` still correctly
wrapped a target method, even if the target method had already been wrapped by
 multiple other decorators. This PR brings the new tests into the 3.11 and 3.10
branches as well.
(cherry picked from commit 32f55d1)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
ambv pushed a commit that referenced this pull request Nov 5, 2021
In order to fix a bug in the 3.9 branch in GH-29394, more tests were added to
``test_functools.py`` to ensure that ``singledispatchmethod`` still correctly
wrapped a target method, even if the target method had already been wrapped by
 multiple other decorators. This PR brings the new tests into the 3.11 and 3.10
branches as well.
(cherry picked from commit 32f55d1)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.