Re: Can someone explain this behavior to me?

2009-02-27 Thread Jesse Aldridge
Ah, I get it. Thanks for clearing that up, guys. -- http://mail.python.org/mailman/listinfo/python-list

Can someone explain this behavior to me?

2009-02-26 Thread Jesse Aldridge
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

Re: Can someone explain this behavior to me?

2009-02-26 Thread Chris Rebert
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

Re: Can someone explain this behavior to me?

2009-02-26 Thread ma
I'm pretty sure that Foo is getting replaced once you import Foo, why not pass the Foo() object to bar's go? I'm sure there are other ways, but yes, circular imports are indeed evil. On Thu, Feb 26, 2009 at 5:13 PM, Chris Rebert c...@rebertia.com wrote: On Thu, Feb 26, 2009 at 1:48 PM, Jesse

Re: Can someone explain this behavior to me?

2009-02-26 Thread John Machin
On Feb 27, 8:48 am, 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

Re: Can someone explain this behavior to me?

2009-02-26 Thread Albert Hopkins
On Thu, 2009-02-26 at 13:48 -0800, Jesse Aldridge 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

Re: Can someone explain this behavior to me?

2009-02-26 Thread Steve Holden
Jesse Aldridge 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 -