python: support for kwarg functions