On Tue, 15 Sep 2009 at 21:43, M.-A. Lemburg wrote:
Barry Warsaw wrote:
On Sep 15, 2009, at 2:41 PM, Paul Moore wrote:
MAL pointed out http://code.activestate.com/recipes/573441/ - extended
optparse to allow definition of required options. Given that one of
the requirements that argparse is claimed to meet where optparse
doesn't is supporting required arguments, how come this simple recipe
hasn't been incorporated into optparse?
That's an excellent question which kind of says something about people's
enthusiasm for maintaining optparse, eh?
It says something about the apparent importance of this particular
feature in an argument parsing module ;-)
Actually I believe I heard from someone other than Laura that required
options were explicitly rejected. And then there's this from the
documentation for optparse:
required option
an option that must be supplied on the command-line; note that the
phrase ???required option??? is self-contradictory in English. optparse
doesn???t prevent you from implementing required options, but doesn???t
give you much help at it either. See examples/required_1.py and
examples/required_2.py in the optparse source distribution for two
ways to implement required options with optparse.
--David
_______________________________________________
stdlib-sig mailing list
stdlib-sig@python.org
http://mail.python.org/mailman/listinfo/stdlib-sig