> I would like to propose that it be made impossible in the Python
> source to import two instances of the same module.
A fully-automatic solution is more difficult than it might seem at
first:
http://www.python.org/dev/peps/pep-0328/
But there is a simple code-discipline solution: never ever us
On Thu, Sep 24, 2009 at 2:51 PM, Ethan Furman wrote:
> I believe that modules are imported only once
>
That's *mostly* true, but try this one:
A.py:
print 'Importing A'
import B
B.py:
print 'Importing B'
import A
Cashew:/tmp$ python2.5 B.py
Importing B
Importing A
Importing B
--
Daniel Stutz
Zac Burns wrote:
On Thu, Sep 24, 2009 at 1:38 PM, Carl Banks wrote:
On Sep 24, 10:26 am, Zac Burns wrote:
Currently it is possible to import a file of one path to more than one
'instance' of a module. One notable example is "import __init__" from
a package.
Seehttp://stackoverflow.com/questi
On Thu, Sep 24, 2009 at 1:38 PM, Carl Banks wrote:
> On Sep 24, 10:26 am, Zac Burns wrote:
>> Currently it is possible to import a file of one path to more than one
>> 'instance' of a module. One notable example is "import __init__" from
>> a package.
>> Seehttp://stackoverflow.com/questions/436
On Sep 24, 10:26 am, Zac Burns wrote:
> Currently it is possible to import a file of one path to more than one
> 'instance' of a module. One notable example is "import __init__" from
> a package.
> Seehttp://stackoverflow.com/questions/436497/python-import-the-containin...
>
> This recently cause
Zac Burns wrote:
Currently it is possible to import a file of one path to more than one
'instance' of a module. One notable example is "import __init__" from
a package. See
http://stackoverflow.com/questions/436497/python-import-the-containing-package
This recently caused a devastating bug in s
Currently it is possible to import a file of one path to more than one
'instance' of a module. One notable example is "import __init__" from
a package. See
http://stackoverflow.com/questions/436497/python-import-the-containing-package
This recently caused a devastating bug in some of my code. Wha