Skip to content

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

Merged
ambv merged 7 commits into
python:3.9from
AlexWaygood:3.9
Oct 28, 2021
Merged

ambv merged 7 commits into
python:3.9from
AlexWaygood:3.9

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Oct 20, 2021 •

Copy link
Copy Markdown
Member

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

AlexWaygood commented Oct 20, 2021 •

Copy link
Copy Markdown
Member Author

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

@AlexWaygood

Copy link
Copy Markdown
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 :)

Comment thread Lib/functools.py Resolved
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