-
Notifications
You must be signed in to change notification settings - Fork 748
RuntimeBinderException - Cannot implicitly convert type 'Python.Runtime.PyObject' to 'System.Collections.Generic.List<string>' #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@tomhunter-gh can you try from the master?
This should have been fixed recently: |
Hi @denfromufa I pulled latest from master but I'm afraid I still get the problem. It looks like casting to a Were you able to reproduce the issue? What I did was I added the Thanks |
@tomhunter-gh can you share your full project in a zip file? just paste it here to this issue. fixtures are not included because it is python code, but could be included as a resource. we have a separate pyproj in the directory with python tests. |
By the way I'm using Python 3.6 32-bit, so you may need to change settings in the Python.Runtime project file. My test is in: pythonnet\src\embed_tests\pyimport.cs Thanks |
@tomhunter-gh actually that pull request which I linked above #427 leads to this issue :( Here is the code that I commented out to pass your the test:
The reason is because before the list is passed back to C#, it gets converted to Python list. So quick workaround would be to provide equivalent conversion from Python to C#: But this is of course a lot of conversion back and forth and maybe a performance issue. |
This is rather hackish workaround, but passes all tests! Use at your own risk :) |
related issue: |
I believe this should already be fixed in 3.0, but we need a test. |
Environment
Details
I have the following code:
Interface1.cs
Class1.cs
Module1.py
Test
I am trying to do something like what the following test is trying to do:
Exception
However, I get the following exception:
Is it possible to marshall generic .NET Lists?
The text was updated successfully, but these errors were encountered: