Question:
I’m trying to remake GitHub - Matt-DESTROYER/textadventure: A small Python package to make creating your own text adventure games easy! but actual code. I have an Action
class with a function called run
.
I have other classes that inherit Action
and I want to call the parent class (Action
)'s run
function.
I tried using super()
which worked for super().__init__()
but it’s not working with super().run()
I know run
isn’t doing anything right now but in the future I will probably add stuff to it.
Repl link:
https://replit.com/@QwertyQwerty54/TextAdventures
Code snippet:
class Action:
def __init__(self) -> None:
pass
def run(self) -> None:
pass
class Text:
def __init__(self, text) -> None:
super().__init__()
self.text = text
def run(self):
super().run()
print(self.text)