[New-bugs-announce] [issue45684] `functools.singledispatchmethod` does not define `__class_getitem__`

Alex Waygood report at bugs.python.org
Mon Nov 1 14:23:01 EDT 2021


New submission from Alex Waygood <Alex.Waygood at Gmail.com>:

`functools.singledispatchmethod` is marked as being a generic class in `typeshed`, but does not define `__class_getitem__`, so cannot be parameterized at runtime.

cpython source code: https://github.com/python/cpython/blob/e2063d6a1ebc3568e90a14ed163fa291b5977ae8/Lib/functools.py#L891

typeshed stub: https://github.com/python/typeshed/blob/f4143c40e85db42dc98549e09329e196668395ee/stdlib/functools.pyi#L94

----------
components: Library (Lib)
messages: 405462
nosy: AlexWaygood, lukasz.langa, rhettinger
priority: normal
severity: normal
status: open
title: `functools.singledispatchmethod` does not define `__class_getitem__`
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45684>
_______________________________________


More information about the New-bugs-announce mailing list