]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-39679: Add tests for classmethod/staticmethod singledispatchmethods (GH-29034)
authorAlex Waygood <Alex.Waygood@Gmail.com>
Tue, 19 Oct 2021 20:30:27 +0000 (21:30 +0100)
committerGitHub <noreply@github.com>
Tue, 19 Oct 2021 20:30:27 +0000 (22:30 +0200)
commitad6d162e518963711d24c80f1b7d6079bd437584
tree04d24b5533d5527c06707048881a8ce3d719e311
parentf4b12440cf24d7636755aac5b2645e47713557c7
bpo-39679: Add tests for classmethod/staticmethod singledispatchmethods (GH-29034)

In Python 3.8 and 3.9, 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)`. This was not caught by unit tests, however, as the
tests only tested the `@method.register(int)` way of registering additional
implementations. The bug is no longer present in Python 3.10+, but
`test_functools.py` is still lacking regression tests for these cases. This
commit adds these test cases.
Lib/test/test_functools.py
Misc/NEWS.d/next/Tests/2021-10-18-16-18-41.bpo-39679.F18qcE.rst [new file with mode: 0644]