David Stanek <dstanek at dstanek.com> writes: > On Mon, Mar 8, 2010 at 10:40 AM, Steven Bethard > <steven.bethard at 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4