Message409295
You can dispatch on collections.abc.Sequence.
@functools.singledispatch
def f(a: collections.abc.Sequence) -> None:
pass
But MyPy complains about this:
error: Missing type parameters for generic type "Sequence"
MyPy requires parametrized generic (like collections.abc.Sequence[int]), but singledispatch() does not work with it. |
|
Date |
User |
Action |
Args |
2021-12-29 08:28:12 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, rhettinger, kj |
2021-12-29 08:28:12 | serhiy.storchaka | set | messageid: <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org> |
2021-12-29 08:28:12 | serhiy.storchaka | link | issue46191 messages |
2021-12-29 08:28:11 | serhiy.storchaka | create | |
|