I am trying to figure out how to have a child class reside in another module. Currently it is more convenient for me to store the parent and child classes in different modules due to their size. I need the super method, since I want to inherit not just all the functions, but the variables in self as well. My current solution is as follows:
Parent Module (parent.py):
class A: def __init__(self, *args, **kwargs): super(A, self).__init__(*args, **kwargs)
from parent import A class B(A): def __init__(self, *args, **kwargs): super(B, self).__init__(*args, **kwargs) B()
When I run the child module I get the following error.
TypeError: super(type, obj): obj must be an instance or subtype of type
I understand that this is due to the module reloading and thus causing data to be lost, however I am not sure if there is a workaround.