I'm currently working on a project in Python (for .NET) that calls functions from a C# .dll. There's a nullable type (double?) argument in one of the C# functions and apparently I have to edit the python source code (Creating a C# Nullable Int32 within Python (using Python.NET) to call a C# method with an optional int argument), which I'd prefer not to do in case other people will use this nor do I want to update the C# code to handle this case of conversion.
For now, I've tried the following:
nullable_double = System.Nullable[System.Double]()
func(nullable_double)
This gives me the following error:
ArgumentException: Object of type 'System.RuntimeType' cannot be converted to type 'System.Nullable`1[System.Double]'.
I also tried just passing in 'None' but that didn't work as well. Is there anyway I can do this without changing the python source code or the c# dll?