Python: allow all types of callables.

...such as lambdas and types in addition to actual functions.