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.

classification
Title: optparse: please provide a usage example in the module docstring
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, mgedmin
Priority: normal Keywords:

Created on 2009-04-07 16:01 by mgedmin, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg85722 - (view) Author: Marius Gedminas (mgedmin) * Date: 2009-04-07 16:01
Please add a simple usage example to the module docstring in
optparse.py.  The example available in the Python library reference
would suffice (see http://python.org/doc/current/library/optparse.html).

Rationale: optparse is convenient, but a bit unintuitive.  As a single
data point, it took me a couple of years until I started remembering the
syntax without having to refer to the documentation (compare this with,
e.g. the csv module which you'll remember how to use after reading the
docs once).  Intuitively I always typed pydoc optparse in a terminal
window and was disappointed with the lack of examples.  The online docs
are good, but not as easy to reach as pydoc.

In my experience, it's quite often that when you reach for optparse
you're alreay shaving a yak (solving a problem needed to solve the real
problem), and the five extra mouse clicks needed to find optparse's docs
in the browser are rather disruptive.
msg85919 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-12 20:31
Added in r71540. Thanks for the suggestion!
History
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49969
2009-04-12 20:31:16georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg85919
2009-04-07 16:01:26mgedmincreate