Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49871

Re: Coping with cyclic imports

References <87bq4knmax.fsf@physik.rwth-aachen.de> <bc7429c5-7771-4529-9554-f494f393cbb6@googlegroups.com>
From Oscar Benjamin <oscar.j.benjamin@gmail.com>
Date 2013-07-04 16:03 +0100
Subject Re: Coping with cyclic imports
Newsgroups comp.lang.python
Message-ID <mailman.4236.1372950228.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 4 July 2013 13:48,  <kanchan.n.mahajan@gmail.com> wrote:
> On Tuesday, April 8, 2008 10:06:46 PM UTC+2, Torsten Bronger wrote:
[snip]
>
> If you do "import foo" inside bar and "import bar" inside foo, it will work fine. By the time anything actually runs, both modules will be fully loaded and will have references to each other.
>
> The problem is when instead you do "from foo import abc" and "from bar import xyz". Because now each module requires the other module to already be compiled (so that the name we are importing exists) before it can be compiled.
>
> from
> http://stackoverflow.com/questions/744373/circular-or-cyclic-imports-in-python

Is there some reason you're responding to a post from 5 years ago?

Or is it just a joke that you've created a cyclic import advice link
by referring to a SO question where the top answer is actually a quote
linking back to the previous post in this same thread?


Oscar

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Coping with cyclic imports kanchan.n.mahajan@gmail.com - 2013-07-04 05:48 -0700
  Re: Coping with cyclic imports Dave Angel <davea@davea.name> - 2013-07-04 09:33 -0400
  Re: Coping with cyclic imports Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-07-04 16:03 +0100
    Re: Coping with cyclic imports kanchan.n.mahajan@gmail.com - 2013-07-04 08:11 -0700
      Re: Coping with cyclic imports Dave Angel <davea@davea.name> - 2013-07-04 18:12 -0400

csiph-web