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.



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to