This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients gvanrossum, kj, rhettinger, serhiy.storchaka
Date 2021-12-29.08:28:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-12-29 08:28:12serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, rhettinger, kj
2021-12-29 08:28:12serhiy.storchakasetmessageid: <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org>
2021-12-29 08:28:12serhiy.storchakalinkissue46191 messages
2021-12-29 08:28:11serhiy.storchakacreate