[docs] [issue14034] Add argparse howto

Tshepang Lekhonkhobe report at bugs.python.org
Mon Mar 19 12:02:10 CET 2012

Tshepang Lekhonkhobe <tshepang at gmail.com> added the comment:

> Find attached. Note that I kept some of those anti-pattern examples
> you mentioned, and then later on introduced your preferred way of
> doing things (using action="count" and ">=" checks instead of "=="
> ones).

Reason I kept those is to easily lead the reader into the "more
correct" way of doing things, by first doing them in a more obvious
but less ideal way.

For example, when the goal of one is to teach one to remove duplicates
from list, it's nice if you first do the process manually, and then
later on introduce the set() type, just so the user can appreciate
them more. Same applies to doing "for item in range(len(iterable))"
vs. "for item in iterable".


Python tracker <report at bugs.python.org>

More information about the docs mailing list