]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.9] bpo-39679: Fix `singledispatchmethod` `classmethod`/`staticmethod` bug (GH...
authorAlex Waygood <Alex.Waygood@Gmail.com>
Thu, 28 Oct 2021 16:02:04 +0000 (17:02 +0100)
committerGitHub <noreply@github.com>
Thu, 28 Oct 2021 16:02:04 +0000 (18:02 +0200)
commit97388c204b557f30e48a2b2ef826868702204cf2
treec6e20a9bb0e3da86ebd1777350a1694afafa3779
parent8365a5b5abe51cbe4151d89a5d0a993273320067
[3.9] bpo-39679: Fix `singledispatchmethod` `classmethod`/`staticmethod` bug (GH-29087)

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.

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Lib/functools.py
Lib/test/test_functools.py
Misc/NEWS.d/next/Library/2021-10-20-10-07-44.bpo-39679.nVYJJ3.rst [new file with mode: 0644]