
Dec. 6, 2013
11:31 a.m.
That said, I like how __main__.py makes a clear separation between the
On Dec 6, 2013 9:29 AM, "Eric Snow" <ericsnowcurrently@gmail.com> wrote: package and its script form. As I said in my opening email, I think that distinction is very fuzzy for modules in general and bites both beginners and advanced users. For me anything that proposed replacing the current "if __name__ == '__main__'" idiom should help make the script/module separation more distinct. Regardless, it may be worth adding an additional approach to highlighting the script/module duality. We could raise a warning when a module (findable on sys.path) is run as script unless via the "-m" flag. -eric