How about some syntactic sugar for " __name__ == '__main__' "?

Ian Kelly ian.g.kelly at
Sun Nov 16 18:15:29 CET 2014

On Sun, Nov 16, 2014 at 3:39 AM, Vito De Tullio <vito.detullio at> wrote:
> for the "right time" you can choose to spin a thread and wait to the end of
> the load of the module

Yuck. "Just add threads" is /not/ the answer to everything.

This case looks fairly harmless on the surface, although I could
imagine it breaking things that might object to the main thread being
changed, e.g. things that use event loops or that rely in some way on
the threading.main_thread() function.

More information about the Python-list mailing list