On Thu, Feb 26, 2009 at 1:48 PM, Jesse Aldridge <jessealdri...@gmail.com> wrote: > I have one module called foo.py > --------------------- > class Foo: > foo = None > > def get_foo(): > return Foo.foo > > if __name__ == "__main__": > import bar > Foo.foo = "foo" > bar.go() > --------------------- > And another one called bar.py > --------------------- > import foo > > def go(): > assert foo.get_foo() == "foo" > ---------------------- > When I run foo.py, the assertion in bar.py fails. Why?
Not sure, but circular imports are *evil* anyway, so I'd suggest you just rewrite the code to avoid doing any circular imports in the first place. Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list