-
-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request