super(self)__.init__ code example
Example 1: python super init
class test:
def __init__(self, *args):
print(f"called test with: {args}")
class testing(test):
def __init__(self, *args):
print(f"Called testing with: {args}")
super().__init__(*args)
testing("hmm")
# super is a keyword that calls the parent class
Example 2: super().__init__(pos, model) in python
def __init__(self, pos, model, agent_type):
super().__init__(pos, model)
self.pos = pos
self.type = agent_type