bpo-39452: Rewrite and expand __main__.rst (#26883)

Broadened scope of the document to explicitly discuss and differentiate between ``__main__.py`` in packages versus the ``__name__ == '__main__'`` expression (and the idioms that surround it), as well as ``import __main__``.

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
Co-authored-by: Éric Araujo <merwok@netwok.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Jack DeVries 2021-08-24 13:01:41 -04:00 committed by GitHub
parent a24676bedc
commit 7cba23164c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 369 additions and 17 deletions

View file

@ -975,6 +975,8 @@ should expose ``XXX.YYY.ZZZ`` as a usable expression, but .moduleY is
not a valid expression.
.. _import-dunder-main:
Special considerations for __main__
===================================