semi-newbie module namespace confusion

Andrew Gwozdziewycz apgwoz at gmail.com
Tue Oct 4 07:12:18 EDT 2005


>>
> well, in my opinion python is not trying hard enough. to me it is
> immediately obvious that the main module gets evaluated twice and
> i am rather sure that one could introduce some magic of the kind
> "oh, i reevaluate the main script here, the module does not get filled
> the usual way but uses the existing objects instead". this would have
> to happen on a very low level (when the file i just read from is  
> known)
> but i think it would be possible. whether the effort to do so is worth
> it, is a different question...

There is an easy fix to this situation, and it's called creating a  
new script that imports the modules. If it's truely a module (which I  
guess really everything in python is), it probably should only be run  
by itself for testing purposes only.


>>> Now i wonder how difficult it would be to "correct" the behavior?
>>>
>>
>> there's no way to "fix" it without introducing a huge number of  
>> inconsistencies.


Plus, it's not broken to begin with.


---
Andrew Gwozdziewycz
apgwoz at gmail.com
http://ihadagreatview.org
http://plasticandroid.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20051004/6bf7fc6f/attachment.html>


More information about the Python-list mailing list