I have a constructor in my parent class that takes four parameters. In my subclass, I need to have one that takes three parameters. In the parent class I the first parameter is length. The subclass will have a set length.
I have tried many things, but none of them have worked. The one in the code that I added is one of them.
class X:
def __init__(self, len, speed, locate, direction):
self._len = len
self._speed = speed
self._locate = locate
self._direction = direction
from X import X
class Y(X):
def __int__(self, speed, locate, direction):
super().__init__(speed, locate, direction)
# one thing I've tried
self._len = 3.0
When I create an object and try to pass three parameters in it says that I am missing a direction.