Can a python subclass be store in a seperate module from its superclass
<p>I've written some code that contains a main and a number of subclasses that inherit variables from a superclass.</p>

<p>E.g.</p>

<pre><code>class superclass(object):
    def __init__(self, var1, var2):
        self.var1 = var1
        self.var2 = var2

class subclass1(superclass):
    def method1(self):
        pass

class subclass2(superclass):
    def method1(self):
        pass
</code></pre>

<p>The main isn't shown, nor an option factory which is used to choose the subclass to call, but hopefully the info given will be sufficient.</p>

<p>I wish to convert those classes to standalone modules that can be imported.
It is expected that additional subclasses will be written in the future so I was wondering if it is possible to save each subclass and the superclass as seperate modules and that the subclasses will still be able to use/have access too the superclass variables and definitions.</p>

<p>The reasoning behind this is to simplify the writing of any future subclasses. Meaning they can be written as a stand alone module and the previous subclasses and the superclass don't have to be touched as part of the development, but they will still be able to use the suberclasses variables and definitions.</p>

<p>I'm not sure how it would work or if it can be done that way. Whether I just save all the classes as superclass.py, subclass1.py and subclass2.py and import them all?????</p>

<p>Hope that made sense.</p>

<p>Thanks.</p>
