I have a python project with the following structure:
class A:
def __init__(self):
# Long startup
class B(A):
def __init__(self):
A.__init__(self)
class C(A):
def __init__(self):
A.__init__(self)
The problem is that A takes a long time to initialize, and I don't want to have to run it twice. Is it possible to "skip" the __init__ of A on any occurrence after the first one?
I know that I can inherit B in C (rather than A), but that doesn't seem natural, seeing as B and C are completely different parts of my program.