Newbie packages Q

MarkyMarc marcsgbrevkonto at gmail.com
Sun Oct 7 16:41:14 CEST 2007


On Oct 7, 4:24 pm, Bruno Desthuilliers <bruno.
42.desthuilli... at wtf.websiteburo.oops.com> wrote:
> MarkyMarc a écrit :
> (snip)
>
> > And the atest and btest, shouldn't they be able to import each
> > other??
>
> import is a statement. It's executed, like any other top-level code,
> when the module is imported (or the script loaded into the interpreter
> if it's called directly). So if A.py imports B.py and B.py imports A.py,
> you do have a circular reference that can't be solved.
>
> Anyway, circular dependencies are Bad(tm), so you *don't* want such a
> situation.

Yes it is bad and I would not do it in production. But shouldn't I be
able to call one module from another module inside a package?




More information about the Python-list mailing list