[Python.NET] Invoking a C# method with a python list
Mohamed Koubaa <[email protected]> Mon, 30 Jul 2018 11:43:26 -0500
| Newsgroups | gmane.comp.python.dotnet |
|---|---|
| Message-ID | <CAJBOL5uzj2xMyBGJGSUP2QSEr4Z8jqpFFYuqMWmP7PGFE58ojA@mail.gmail.com> |
Hello,
I am using the 2.3 release branch.
I have C# code like this:
public class A {
public A() {...}
}
public class B {
public B() {...}
public static void Func(IEnumerable<A> input){
}
}
I want to pass in a python list to Func but get this error:
>>> b=B()
>>> b.Func([A(), A()])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: No method matches given arguments
I tried both IEnumerable and IList in the signature of 'Func'. I know that
I can import System and create some .NET collection type and it works well.
Did I miss anything? Is this usage pattern within the design goals of
pythonnet? I assume this would have to be fixed in MethodBinder but I
wanted to try asking here first.
Thanks!
Mohamed Koubaa
_________________________________________________
Python.NET mailing list - [email protected]
https://mail.python.org/mailman/listinfo/pythondotnet