Nick Coghlan <ncogh...@gmail.com> added the comment:

Yes, this is deliberate. From the run_module documentation: "__name__ is set to 
run_name if this optional argument is not None, to mod_name + '.__main__' if 
the named module is a package and to the mod_name argument otherwise."

This allows arbitrary code to be executed to populate a namespace, but you have 
to explicitly opt-in to having a second pseudo-__main__ module run in the same 
process (with all the potential pickle compatibility issues that doing so 
creates).

----------
resolution:  -> not a bug

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37941>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to