mirror of
https://github.com/python/cpython
synced 2024-10-15 08:28:17 +00:00
gh-110138: Improve grammar in idiomatic usage of `__main__.py
` (#110142)
This commit is contained in:
parent
31097df611
commit
adf0f15a06
|
@ -238,9 +238,9 @@ package. For more details, see :ref:`intra-package-references` in the
|
|||
Idiomatic Usage
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
The contents of ``__main__.py`` typically isn't fenced with
|
||||
``if __name__ == '__main__'`` blocks. Instead, those files are kept short,
|
||||
functions to execute from other modules. Those other modules can then be
|
||||
The content of ``__main__.py`` typically isn't fenced with an
|
||||
``if __name__ == '__main__'`` block. Instead, those files are kept
|
||||
short and import functions to execute from other modules. Those other modules can then be
|
||||
easily unit-tested and are properly reusable.
|
||||
|
||||
If used, an ``if __name__ == '__main__'`` block will still work as expected
|
||||
|
|
Loading…
Reference in a new issue