The Wayback Machine - https://web.archive.org/web/20211022025649/https://github.com/python/cpython/pull/29087
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.9] bpo-39679: Fix singledispatchmethod classmethod/staticmethod bug #29087

Open
wants to merge 3 commits into
base: 3.9
Choose a base branch
from

Conversation

@AlexWaygood
Copy link
Contributor

@AlexWaygood AlexWaygood commented Oct 20, 2021

This commit fixes a bug in the 3.9 branch where stacking
@functools.singledispatchmethod on top of @classmethod or @staticmethod
caused an exception to be raised if the method was registered using
type-annotations rather than @method.register(int). Tests for this scenario
were added to the 3.11 and 3.10 branches in #29034 and #29072; this commit
also backports those tests to the 3.9 branch.

The solution proposed in this commit partially derives from ideas suggested by Karthikeyan Singaravelan and Dmitry Kulazhenko in the thread on bugs.python.org.

https://bugs.python.org/issue39679

This commit fixes a bug in the 3.9 branch where stacking
`@functools.singledispatchmethod` on top of `@classmethod` or `@staticmethod`
caused an exception to be raised if the method was registered using
type-annotations rather than `@method.register(int)`. Tests for this scenario
were added to the 3.11 and 3.10 branches in python#29034 and python#29072; this commit
also backports those tests to the 3.9 branch.
@AlexWaygood AlexWaygood requested a review from rhettinger as a code owner Oct 20, 2021
@AlexWaygood AlexWaygood changed the title bpo-39679: Fix singledispatchmethod classmethod/staticmethod bug [3.9] bpo-39679: Fix singledispatchmethod classmethod/staticmethod bug Oct 20, 2021
@AlexWaygood
Copy link
Contributor Author

@AlexWaygood AlexWaygood commented Oct 20, 2021

I'm fairly new to reStructuredText — any idea what's causing the CI failure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants