At 02:58 PM 7/14/2007 +1200, Greg Ewing wrote: >Andy C wrote: > > What does "if __name__ == '__main__" mean in > > __main__.py? : ) If someone tries does import __main__ from another > > module in the program, won't that result in an infinite loop? > >Is there a reason not to use __init__.py for this?
Even some moderately-experienced Python developers confuse the concepts of "package" and "directory containing Python code" -- let's not make it worse by encouraging the inclusion of an __init__ module in the top-level package namespace! _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com