Suffixing the type onto the dummy method isn't the listed style for singledispatch, but seems common if you want to process your code by a type checker which is what I've done here. Tests and type checker pass, though I think it means the type checkers believe most of the implementations are dead code.
Alternatives:
use comment disables
rewrite singledispatch with @overload and our own dispatch on the argument
AB#19879 specifically AB#19886
Some good changes:
is_derivation
A change I'm not totally happy with:
The overall situation is that mypy has numerous limitations with functools.singledispatch see https://github.com/python/mypy/issues/8356
Suffixing the type onto the dummy method isn't the listed style for
singledispatch
, but seems common if you want to process your code by a type checker which is what I've done here. Tests and type checker pass, though I think it means the type checkers believe most of the implementations are dead code.Alternatives:
singledispatch
with @overload and our own dispatch on the argument