How can I split a module into multiple files, without breaking a backwards compatibly?

Sure you can, just import the classes in the __init__.py:

# in __init__.py
from model.foo import Foo
from model.bar import Bar

And then when you wish to use them you can:

>>> import model
>>> model.Bar()
<model.bar.Bar object at 0x31306d0>

or

>>> from model import Foo
>>> Foo()
<model.foo.Foo object at 0x31307d0>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)