danb_83 at yahoo.com
Fri Jun 27 06:00:09 CEST 2008
On Jun 26, 10:40 pm, James <rent.lupin.r... at gmail.com> wrote:
> Hi all,
> I'm looking for some advice dealing with cyclic, cross-package
> I've created the following demo file structure:
> a.py imports a class from b.py and vice versa, and main.py imports
> them both.
> However, because a.py has not been completely read by the time it gets
> to the:
> from b import b
> line, the
> from a import a
> line in b.py fails with an import error (stack trace at the end).
> I hope that's clear: basically, because of the cyclic import, I see
> incomplete modules which can't be imported.
> Can I have this module hierarchy in some other way?
# refer to b.b
# refer to a.a
More information about the Python-list