Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/__main__.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ error-prone as other functions within the module could be unintentionally using
the global variable instead of a local name. A ``main`` function solves this
problem.

Using a ``main`` function has the added benefit of the ``echo`` function itself
Using a ``main`` function has the added benefit of the ``main`` function itself
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a typo.

Copy link
Author

@fossilet fossilet Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my thought was using a main function makes echo importable without side effects, but also exposes a new importable name main.

being isolated and importable elsewhere. When ``echo.py`` is imported, the
``echo`` and ``main`` functions will be defined, but neither of them will be
called, because ``__name__ != '__main__'``.
Expand Down
Loading