[IronPython] Expose a C# function as a Python function taking a default argument
Jeff Hardy
jdhardy at gmail.com
Sun Nov 18 21:30:53 CET 2007
Hi all,
I have a function declared in C#:
void StartResponse(string status, List response_headers, Tuple exc_info);
I need to pass this to a Python function, and the Python function will
call it. Currently, the code looks like this:
object responsesObj = engine.CallObject(callable, module, environ, new
StartResponseDelegate(StartResponse));
This works fine if all three arguments are passed. However, from the
Python side start_response has this signature:
def start_response(status, response_headers, exc_info=None)
So my question is: How do I expose the C# function as a Python
function with a default argument? It looks like
Runtime.Calls.PythonFunction is what I want, but I couldn't figure out
how to call it - I tried tracing the code and ended up in the bowels
of the DLR.
Thanks,
Jeff
More information about the Ironpython-users
mailing list