I have the following class inheritance structure:
class BuffEvent(object):
def __init__(self, buffable):
self.buffable = buffable
class BattleEvent(BuffEvent):
def __init__(self, battle, buffable):
super(BuffEvent, self).__init__(buffable)
self.battle = battle
class BattleStartEvent(BattleEvent):
def __init__(self, battle, buffable):
super(BattleEvent, self).__init__(battle, buffable)
Then im tryng to call the constructor of BattleStartEvent like this:
BattleStartEvent(battle, battle.attacker)
But i am getting the following error:
super(BattleEvent, self).__init__(battle, buffable)
TypeError: __init__() takes 2 positional arguments but 3 were given
In BattleStartEvent i have 2 parameters in the constructor so im a bit confused. What am i doing wrong here ?
supershould be the class itself, not its super class. Or give no arguments at all, if you’re using a reasonably modern Python version.