Re: circular import Module

2005-06-14 Thread Magnus Lycka
Greg Ewing wrote: > Magnus Lycka wrote: > >> Due to the cycle, you can never use file1 without >> file2 or vice versa. Why do you then want it to be >> two different modules instead of one? > > Perhaps because it would then be too big and > unwieldy to maintain? > > Sometimes there are legitimat

Re: circular import Module

2005-06-13 Thread Greg Ewing
Magnus Lycka wrote: > Due to the cycle, you can never use file1 without > file2 or vice versa. Why do you then want it to be > two different modules instead of one? Perhaps because it would then be too big and unwieldy to maintain? Sometimes there are legitimate reasons for mutually-dependent mod

Re: circular import Module

2005-06-10 Thread Terry Hancock
On Friday 10 June 2005 07:27 am, Magnus Lycka wrote: > [EMAIL PROTECTED] wrote: > > I have two modules (file1.py and file2.py) > > Is that ok in python (without any weird implication) if my module > > import each other. I mean in module file1.py there exist command import > > file2 and in module fi

Re: circular import Module

2005-06-10 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Hello, > > I have two modules (file1.py and file2.py) > Is that ok in python (without any weird implication) if my module > import each other. I mean in module file1.py there exist command import > file2 and in module file2.py there exist command import file1? Even if i

Re: circular import Module

2005-06-08 Thread Greg Ewing
Thomas Guettler wrote: > file1.py: > import file2 > > > file2.py: > # import file1 # Does not work! Actually, that *will* work as long as you don't try to use anything from file1 until it has finished being loaded. What won't work is file2.py: from file1 import somename because som

Re: circular import Module

2005-06-08 Thread Philippe C. Martin
That's the only way out I found with some module import problem using code generated by wxDesigner. Josef Meile wrote: >>>Circular import does not work on module level, but you can >>>import the module in a method: >>> >>>file1.py: >>>import file2 >>> >>> >>> >>>file2.py: >>># import file1 #

Re: circular import Module

2005-06-08 Thread Josef Meile
>>Circular import does not work on module level, but you can >>import the module in a method: >> >>file1.py: >>import file2 >> >> >> >>file2.py: >># import file1 # Does not work! >>def foo(): >>import file1 # Does work > > > Cool idea ! > > It works on local namespaces, wich dont cause t

Re: circular import Module

2005-06-08 Thread Douglas Soares de Andrade
Hi ! > Circular import does not work on module level, but you can > import the module in a method: > > file1.py: > import file2 > > > > file2.py: > # import file1 # Does not work! > def foo(): > import file1 # Does work Cool idea ! It works on local namespaces, wich dont cause trouble t

Re: circular import Module

2005-06-08 Thread Thomas Guettler
Am Wed, 08 Jun 2005 01:11:50 -0700 schrieb [EMAIL PROTECTED]: > Hello, > > I have two modules (file1.py and file2.py) > Is that ok in python (without any weird implication) if my module > import each other. I mean in module file1.py there exist command import > file2 and in module file2.py there

circular import Module

2005-06-08 Thread [EMAIL PROTECTED]
Hello, I have two modules (file1.py and file2.py) Is that ok in python (without any weird implication) if my module import each other. I mean in module file1.py there exist command import file2 and in module file2.py there exist command import file1? This is not working in C#. pujo -- http://m