我有下面的静态C#方法
public static double[] TestMethod(double[] a, double[] b)
我想使用Python NET包从Python调用它。在
^{pr2}$但是我如何为第一个或第二个参数传递null
?在
t2 = MyStaticClass.MyTestMethod(None, [3., 4.]) # fails! TypeError: No method matches given arguments
t3 = MyStaticClass.MyTestMethod([1., 2.], None) # fails! TypeError: No method matches given arguments
我知道当参数a
或beb
是{
public static double[] TestMethodWithANull(double[] b)
{ return TestMethod(null, b); }
public static double[] TestMethodWithBNull(double[] a)
{ return TestMethod(a, null); }
但是我更愿意将一个null
从Python传递到C方法。例如,{cd6}可以在MATLAB中传递。在
目前没有回答
相关问题 更多 >
编程相关推荐