The way out and ref parameters are handled is not compatible with IronPython. In IronPython, out parameters do not have to be provided, in pythonnet, you always have to pass something (but it is not really used). The resulting out parameters are returned as return values in both IronPython and pythonnet, but a void result is always omitted in IronPython whereas it is only omitted in pythonnet if there is only a single out parameter.
Example:
To call method "public static void TwoOut(int i, out string sOut, out int iOut)" you have to use "TwoOut(iIn, sOut, iOut)" in pythonnet with sOut a string and iOut an int, and you will receive a (void, string, int) tuple as the return value; in IronPython, you can call "TwoOut(iIn)" and you get a (string, int) tuple as the result.
The attached patch makes the IronPython behavior available in pythonnet while still keeping compatibility with the existing behavior.
Activity
filmor commented on Jun 13, 2016
Does that patch still apply cleanly?
den-run-ai commented on Jun 13, 2016
@filmor how do I check it quickly?
den-run-ai commented on Jun 13, 2016
I got "Patch format detection failed." with tortoisegit
den-run-ai commented on Jun 27, 2018
https://mail.python.org/pipermail/pythondotnet/2010-November/001011.html
den-run-ai commented on Jun 27, 2018
Well, at least this is clearly documented in the comments of code and partial IPY compatibility:
pythonnet/src/runtime/methodbinder.cs
Line 542 in 8f258ac