[New-bugs-announce] [issue39452] Improve the __main__ module documentation

Géry report at bugs.python.org
Sat Jan 25 09:00:07 EST 2020

New submission from Géry <gery.ogam at gmail.com>:

This PR will apply the following changes on the [`__main__` module documentation](https://docs.python.org/3.7/library/__main__.html):

- correct the phrase "run as script" by "run from the file system" (as used in the [`runpy`](https://docs.python.org/3/library/runpy.html) documentation) since "run as script" does not mean the intended `python foo.py` but `python -m foo` (cf. [PEP 338](https://www.python.org/dev/peps/pep-0338/));
- replace the phrase "run with `-m`" by "run from the module namespace" (as used in the [`runpy`](https://docs.python.org/3/library/runpy.html) documentation) since the module can be equivalently run with `runpy.run_module('foo')` instead of `python -m foo`;
- make the block comment [PEP 8](https://www.python.org/dev/peps/pep-0008/#comments)-compliant (located before the `if` block, capital initialised, period ended);
- add a missing case for which a package's \_\_main\_\_.py is executed (when the package is run from the file system: `python foo/`).

assignee: docs at python
components: Documentation
messages: 360682
nosy: docs at python, maggyero
priority: normal
pull_requests: 17565
severity: normal
status: open
title: Improve the __main__ module documentation
type: enhancement
versions: Python 3.8

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list