I have a single Python module which contains 3 classes: A, A1 and A2.
A1 and A2 derive from A. A contains functions which operate on A1 and A2.
This all works fine when it’s in one .py file. But that file has grown quite long and I would like to split A1 and A2 off into their own files. How can I split this file despite a circular dependency?
modA.py:
modA1.py:
modA2.py:
modfull:
Even if A “processes” A1s and A2s you should be fine because thanks to duck typing you don’t need to import the actual names.