On Sat, Nov 14, 2020 at 05:22:41PM +0000, Jonathan Fine wrote:

> The module __main__ is somewhat special. It's there from the very beginning
> (so far as I can tell).

https://docs.python.org/3/library/__main__.html


[...]
> 2. When initializing the built-in __main__ module, set
>         __main__ = True

The `__main__` module is not so much a special built-in module as a role 
given to any old module. The `__main__` module is whatever module gets 
executed as the main module, if any, otherwise whatever module object 
gets created to house the top level scope of the Python interpreter.


-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/XILGXK523O5EK7AQWILBWYJCRWHSSEFL/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to