You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Derived class in Python not being called by C# #1107
In python I have the specific order class defined as:
classLimitOrder(Order):
def__init__(self):
self.symbol="SQ"defEvaluate( self, bar ):
print( "LimitOrder.Evaluate() - yay python!" )
In C# I have an OMS class with a method: public void AddOrder( Order order )
When I pass in LimitOrder and call a method in the OMS that calls Evaluate, the Order class Evaluate method is called instead of the LimitOrder.Evaluate method.
I'm using python 3.6.7 and VS 2019 / .NET 4.7.2
In searching for this I'm only seeing 1 instance of a similar question being asked but no solid response. The Evaluate() method (and entire Order class for that matter) can be abstract but when I try that I get an error creating the LimitOrder object saying I can't create an abstract class.
Activity
mhsmith commentedon Jul 11, 2023
When making a Python subclass of a C# base class, you must include a
__namespace__attribute. For example, see #567 (comment).