strange behavior when adding
Hello, I'm working with a custom built set of .NET 4 assemblies. The .NET assemblies have a type 'TimeSeries'. These time series can have operations conducted on them (addition, averaging, etc.), which returns a new type ('BinaryOperation'). I can do this in IronPython no problem:
type(tsvalues)
<type 'List[ITimeSeries]'>
type(tsvalues[0]) <type 'TimeSeries'> sumts = tsvalues[0] + tsvalues[1] type(sumts) <type 'BinaryOperation'>
However, in pythonnet the BinaryOperation fails... conducting the identical steps in pythonnet I get the following:
type(tsvalues) System.Collections.Generic.0, Culture=neutral, PublicKeyToken=null]] type(tsvalues[0]) TimeSeries sumts = tsvalues[0]+tsvalues[1]
TypeError Traceback (most recent call last) <ipython-input-79-367816bc7679> in <module>() ----> 1 sumts = tsvalues[0]+tsvalues[1] TypeError: unsupported operand type(s) for +: 'TimeSeries' and 'TimeSeries' Any ideas on why pythonnet and IronPython would handle operations on my class types differently? In pythonnet do my types have to have the .__add__, .__sub__, etc. method-wrappers implemented?? Thank you, john
participants (1)
-
John Burkhart