David Stanek <dsta...@dstanek.com> writes:

> On Mon, Mar 8, 2010 at 10:40 AM, Steven Bethard
> <steven.beth...@gmail.com> wrote:
> >  parser.add_argument ('--plot', action='store_true')
[…]

+1.

> Any reason not to do something like:
>
>   from argparse import actions
>   ...
>   parser.add_argument('--plot', actions.store_true)
>
> Basically a small namespace for the constants.

-1.

That ignores the value to the programmer in specifying keyword arguments
(there are a lot of arguments to the function, making keyword arguments
a better mean-what-you-say choice). To be equivalent, it would have to
be:

    from argparse import actions
    # ...

    parser.add_argument('--plot', action=actions.store_true)

I prefer the string values.

-- 
 \           “Value your freedom or you will lose it, teaches history. |
  `\     “Don't bother us with politics,” respond those who don't want |
_o__)                               to learn.” —Richard Stallman, 2002 |
Ben Finney

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to