-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Description
Right now this results in a dispatch error, because dispatch is based only on unnamed arguments:
@multimethod
def f(foo: str):
return foo
f(foo="bar")
# => DispatchError: ('f: 0 methods found', (), [])Not a huge deal, but some people are rather particular about using named arguments whenever possible. Would this be possible to support?
This would complicate the dispatch algorithm, admittedly. You'd have to keep track of argument names for each overload and, accordingly, rearrange *args / **kwargs in multimethod.__call__(). This could get a bit gross when accounting for argument names that are repeated or arranged in different orders for different overloads ...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels