I currently have a base class like so:
from abc import ABC, abstractmethod
class BaseClass(ABC):
@abstractmethod
def __init__(self, param1, param2):
self._param1 = param1
self._param2 = param2
@abstractmethod
def foo(self):
raise NotImplementedError("This needs to be implemented")
Now I have the abstract method foo that I want a user to override. So if they define a class like this:
from BaseClassFile import BaseClass
class DerrivedClass(BaseClass):
def __init__(self, param1, param2):
super().__init__(param1, param2)
So here the method foo is not over-ridden / defined in the DerrivedClass and when I create an object of this type it throws me a TypeError but I want to throw a NotImplementedError. How do I go about this.
The Current Error:
TypeError: Can't instantiate abstract class FF_Node with abstract methods forward