On 22Jul2018 15:38, Mark Lawrence <breamore...@gmail.com> wrote:
On 22/07/18 05:45, Cameron Simpson wrote:
Circular imports: 2 codependent modules. If you have:

 module A:
   import B
 module B:
   import B

That won't work: the second import (whichever it turns out to be) will fail. One workaround is to make one of the modules put off the import. A better approach is usually to redesign things so that they don't do a mutual import (move classses etc around, or merge them). This is always feasible, but often is.

I don't ever recall seeing a module try to import itself, but then perhaps you meant module B should be importing module A? :)

Yes, sorry. Poor proof reading. - Cameron
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to