2

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

  • single lambda-function (i.e. func(lambda x: x))
  • kwargs (i.e. func(a='some sting', b='some other string'))

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?

1 Answer 1

1

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 :(

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.