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 Daniel Stone
Recipients Daniel Stone, docs@python
Date 2016-03-21.12:11:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1458562294.77.0.347454712136.issue26602@psf.upfronthosting.co.za>
In-reply-to
Content
The argparse documentation starts off, after a couple of sentences, by spending several paragraphs (and a couple of sentences) explaining this gem:
import argparse

parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('integers', metavar='N', type=int, nargs='+',
                   help='an integer for the accumulator')
parser.add_argument('--sum', dest='accumulate', action='store_const',
                   const=sum, default=max,
                   help='sum the integers (default: find the max)')

args = parser.parse_args()
print(args.accumulate(args.integers))


While it is undoubtedly impressive, that a sidebar had to be inserted suggesting people in fact refer to other documentation, suggests it may be inappropriate. As an introduction, it is not particularly approachable (especially if you don't catch the nuance of assigning functions to accumulate), and is probably not going to serve the immediate needs of a lot of the audience: the people who click on the first hit for 'python argparse'.

I would suggest relegating this example elsewhere in the documentation, with a much more straightforward/realistic example to lead the documentation.
History
Date User Action Args
2016-03-21 12:11:34Daniel Stonesetrecipients: + Daniel Stone, docs@python
2016-03-21 12:11:34Daniel Stonesetmessageid: <1458562294.77.0.347454712136.issue26602@psf.upfronthosting.co.za>
2016-03-21 12:11:34Daniel Stonelinkissue26602 messages
2016-03-21 12:11:34Daniel Stonecreate