Re: Problem with python 3.2 and circular imports

2011-03-06 Thread Frank Millman
"Rafael Durán Castañeda" wrote... Thank you for your answer Frank, I think I've found the problem. I was calling modules from inside subpackages, and I need to use them from outside, so I have package in PYTHONPATH. is that correct? But now I have another question: Can I execute an script insi

Re: Problem with python 3.2 and circular imports

2011-03-05 Thread Rafael Durán Castañeda
Thank you for your answer Frank, I think I've found the problem. I was calling modules from inside subpackages, and I need to use them from outside, so I have package in PYTHONPATH. is that correct? But now I have another question: Can I execute an script inside subpackage1 importig modules from su

Re: Problem with python 3.2 and circular imports

2011-03-04 Thread Frank Millman
On February 28 2011 Rafael Durán Castañeda wrote I'm stil totally stuck with relative imports, i' ve tried the example tree from PEP 328 without any result: package/ __init__.py subpackage1/ __init__.py moduleX.py moduleY.py subpackage2/ __init__.py

Re: Problem with python 3.2 and circular imports

2011-02-28 Thread Rafael Durán Castañeda
I'm stil totally stuck with relative imports, i' ve tried the example tree from PEP 328 without any result: package/ __init__.py subpackage1/ __init__.py moduleX.py moduleY.py subpackage2/ __init__.py moduleZ.py moduleA.py Assuming that the

Re: Problem with python 3.2 and circular imports

2011-02-27 Thread Frank Millman
"Steven D'Aprano" wrote in message news:4d6a56aa$0$29972$c3e8da3$54964...@news.astraweb.com... On Sun, 27 Feb 2011 12:08:12 +0200, Frank Millman wrote: Assume the following structure - main.py /pkg __init__.py mod1.py mod2.py main.py from pkg import mod1 mod1.py import

Re: Problem with python 3.2 and circular imports

2011-02-27 Thread Steven D'Aprano
On Sun, 27 Feb 2011 12:08:12 +0200, Frank Millman wrote: > Assume the following structure - > > main.py > /pkg > __init__.py > mod1.py > mod2.py > > main.py > from pkg import mod1 > > mod1.py > import mod2 > > mod2.py > import mod1 If you change the "import mod*" lines

Re: Problem with python 3.2 and circular imports

2011-02-27 Thread Frank Millman
"Ben Finney" wrote in message news:87aahh6401@benfinney.id.au... "Frank Millman" writes: Assume the following structure - main.py /pkg __init__.py mod1.py mod2.py main.py from pkg import mod1 mod1.py import mod2 mod2.py import mod1 What are you expecting the result

Re: Problem with python 3.2 and circular imports

2011-02-27 Thread Ben Finney
"Frank Millman" writes: > Assume the following structure - > > main.py > /pkg >__init__.py >mod1.py >mod2.py > > main.py >from pkg import mod1 > > mod1.py >import mod2 > > mod2.py > import mod1 What are you expecting the result to be? If it's about sharing objects between t

Problem with python 3.2 and circular imports

2011-02-27 Thread Frank Millman
Hi all I thought I was getting the hang of circular imports, but after upgrading to python 3.2 I am stumped again. I know some people think that circular imports are always bad, but others suggest that, provided you understand the potential problems, they can be acceptable. Assume the follow