This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients docs@python, ethan.furman, ezio.melotti, nedbat
Date 2015-07-14.06:54:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Content seems to only be mentioned briefly in a couple of places in the official docs:

The first link only says:
"""For a package, the same effect can be achieved by including a module, the contents of which will be executed when the module is run with -m."""

("-m" should actually use :option:`-m` to automatically link to the second URL.)

The second link mentions in two sentences:
"""Execute the Python code contained in script, which must be a filesystem path (absolute or relative) referring to either a Python file, a directory containing a file, or a zipfile containing a file."""

"""If the script name refers to a directory or zipfile, the script name is added to the start of sys.path and the file in that location is executed as the __main__ module."""

I think it would be better to expand the first link to state clearly what is and what is its purpose.  In addition, the section should clarify a few more things, e.g. when it should be used, what it should contain, if it's ok to have other in the subpackages (e.g. test/ to run the tests with python -m package.test), how it interacts (which one is executed first?).
Perhaps it should also get a glossary entry and/or a short mention in the tutorial together with zip imports.

In addition to the two links above, a Google search returns the stackoverflow question "What is" as first result, and a couple more related questions that could/should be answered by our docs.
Date User Action Args
2015-07-14 06:54:01ezio.melottisetrecipients: + ezio.melotti, nedbat, docs@python, ethan.furman
2015-07-14 06:54:01ezio.melottisetmessageid: <>
2015-07-14 06:54:01ezio.melottilinkissue24632 messages
2015-07-14 06:54:00ezio.melotticreate