I'm trying to convert a c++ library to python.
c++ file
class A
{
public:
virtual void example(paramtype, paramtype) = 0;
void myMethod(void);
}
void A::myMethod(void){
example();
}
class B: public A
{
public:
void example(paramtype p1, paramtype p2); // implemented
}
I am having hard time with implementation of myMethod. I thought of making a variable to hold the example method and invoke the variable in myMethod like below.
python file
class A:
def __init__(self):
self.example = None
def myMethod(self):
self.example()
But then editor says None type can't be called(of course). How can I achieve this?