Hey @sobolevn!
functools.singledispatch now supports using type annotations instead of passing an argument:
@singledispatch
def fun(arg, verbose=False):
...
@fun.register
def _(arg: int, verbose=False):
...
The old syntax still works, but in simple cases like here this helps reduce unnecessary repetition and, as a result, the code looks a bit cleaner.
Would you be interesting in accepting a PR implementing similar interface for _TypeClass.instance?
Hey @sobolevn!
functools.singledispatchnow supports using type annotations instead of passing an argument:The old syntax still works, but in simple cases like here this helps reduce unnecessary repetition and, as a result, the code looks a bit cleaner.
Would you be interesting in accepting a PR implementing similar interface for
_TypeClass.instance?