semi-newbie module namespace confusion

David Murmann david.murmann at rwth-aachen.de
Tue Oct 4 04:03:53 EDT 2005


Fredrik Lundh wrote:
> running a piece of python code as a script isn't the same thing as
> importing it as a module:

I ran into the same problem some time ago and even wanted to post here
about it, but found out that it had been reported as a bug three times
at sourceforge (if i remember correctly). The comments there explained
it of course, but I still think that this behavior is somehow "wrong".
I like to think of the import statement as a way to provide the names
defined in a module to the current namespace, so there is no "this gets
evaluated twice".
Now i wonder how difficult it would be to "correct" the behavior? And
would such a change break any code?

David.



More information about the Python-list mailing list