Egor Biriukov
Egor Biriukov

Reputation: 679

Python generic functions dispatching

Is there are any way to dispatch a function which arguments may be:

As I see it, singledispatch decorator from functools only supports dispatching on the first argument, which in my case won't work. Am I missing something?

Upvotes: 2

Views: 82

Answers (1)

Yoav Glazner
Yoav Glazner

Reputation: 8066

You are not missing anything. single dispatch won't solve your problem

https://pypi.python.org/pypi/multipledispatch

can help you with positional arguments but not keywords :(

Upvotes: 1

Related Questions