Although you generally would want to design so that this does not happen, 
if the import of the first module is only needed in some of the functions 
in the second module, you can include the import within the function 
definition and that would  work ok.
But you can't have the second import at the module level.

Chris




Steve Willoughby <[email protected]> 
Sent by: tutor-bounces+christopher.henk=allisontransmission....@python.org
12/16/2008 03:08 PM

To
spir <[email protected]>
cc
*tutor <[email protected]>
Subject
Re: [Tutor] reciprocal import






spir wrote:
> Is it legal or possible  at all for two modules to import each other? I
> tried several ways and had several kinds of error messages. Usually
> "can't import...".

My first impression here is that this sounds like a bad class/module 
design if they're really that interdependent.
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to