I have these classes:
class Human:
def __init__(self, x_position, y_position):
self.y_position = y_position
self.x_position = x_position
class Feared(Human):
def __init__(self, x_position=0, y_position=0, fear_percent=0):
self.y_position = y_position
self.x_position = x_position
self.fear_percent=fear_percent
Greetings, so I have these classes, I want to make a couple of Human objects and after that I want to transform them into Feared objects. How do you generally solve this problem? In C++ I could refedine the = operator, can I do this in Python? Or I could create a constructor/function which has specified argument types. But here variables are specified when adding them in the arguments of the function. So can I make two init functions, one which has one arg type human and the other one which I have already created ?
So how do you workaround the fact that python can't make more than one constructor