Environment
- Pythonnet version: 2.3.0 and 2.4.0
- Python version: 3.6.5
- Operating System: W10
Details
The C# side
public enum MyEnum: byte
{
Success= (byte)'S',
Error = (byte)'E'
}
public class MyClass
{
public Dictionary<Enum, BlockingCollection<ISomeInterface>> MyDictionary { get; }
public MyClass()
{
MyDictionary = new Dictionary<Enum, BlockingCollection<ISomeInterface>>();
}
}
On the python side, I began with this code
from System.Collections.Concurrent import BlockingCollection
from MyModule import MyClass, ISomeInterface, MyEnum
obj = MyClass()
collection = BlockingCollection[ISomeInterface]()
obj.MyDictionary.Add(MyEnum.Success, collection)
This fails with TypeError: No method matches given arguments for Add. I've tried what seemed to solve it for #935 but get the same results
from System.Collections.Concurrent import BlockingCollection
from System import Enum
from MyModule import MyClass, ISomeInterface, MyEnum
obj = MyClass()
collection = BlockingCollection[ISomeInterface]()
obj.MyDictionary.Add[Enum, BlockingCollection[ISomeInterface]](MyEnum.Success, collection)
This fails with TypeError: No match found for given type params
- The output of
print(obj.MyDictionary.Add.__overloads__) is
Void Add(System.Enum, System.Collections.Concurrent.BlockingCollection`1[MyModule.ISomeInterface])
UPDATE
Running this code alone actually works, add shows as a bound method in the debugger:
add = obj.MyDictionary.Add.Overloads[Enum, BlockingCollection[ISomeInterface]]
However, attempting to call the function always fails. I've attempted passing System.byte and 0, instead of the enum, but none of them work.
add(MyEnum.Success, collection)
obj.MyDictionary.Add[Enum, BlockingCollection[ISomeInterface]](MyEnum.Success, collection)
obj.MyDictionary.Add.Overloads[Enum, BlockingCollection[ISomeInterface]](MyEnum.Success, collection)
Environment
Details
The C# side
On the python side, I began with this code
This fails with
TypeError: No method matches given arguments for Add. I've tried what seemed to solve it for #935 but get the same resultsThis fails with
TypeError: No match found for given type paramsprint(obj.MyDictionary.Add.__overloads__)isUPDATE
Running this code alone actually works,
addshows as a bound method in the debugger:However, attempting to call the function always fails. I've attempted passing System.byte and 0, instead of the enum, but none of them work.