X Tutup
The Wayback Machine - https://web.archive.org/web/20250819001433/https://github.com/python/cpython/pull/29087
Skip to content

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

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

Merged
merged 7 commits into from
Oct 28, 2021

Conversation

AlexWaygood
Copy link
Member

@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 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
Member Author

AlexWaygood commented Oct 20, 2021

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

@AlexWaygood
Copy link
Member Author

@ambv could you possibly take a look at this, if you have the time? Would be great to get this bugfix in for 3.9.8 :)

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.

5 participants
X Tutup