On 06/28/2013 10:28 PM, Steven D'Aprano wrote:
I'm willing to concede that, just maybe, something like argparse could
default to "catch exceptions and exit" ON rather than OFF.
On this we can agree. :)
--
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
On 29/06/2013 06:28, Steven D'Aprano wrote:
On Fri, 28 Jun 2013 18:36:37 -0700, Ethan Furman wrote:
On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
[rant]
I think it is lousy design for a framework like argparse to raise a
custom ArgumentError in one part of the code, only to catch it
elsewher
On 2013.06.29 09:12, Roy Smith wrote:
> What is the tracker issue number or url?
http://bugs.python.org/issue9938
--
CPython 3.3.2 | Windows NT 6.2.9200 / FreeBSD 9.1
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
Terry Reedy wrote:
> > So a library that behaves like an app is OK?
>
> No, Steven is right as a general rule (do not raise SystemExit), but
> argparse was considered an exception because its purpose is to turn a
> module into an app. With the responses I have seen here, I agree
On 05:28 Sat 29 Jun , Steven D'Aprano wrote:
> On Fri, 28 Jun 2013 18:36:37 -0700, Ethan Furman wrote:
>
> > On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
> >>
> >> [rant]
> >> I think it is lousy design for a framework like argparse to raise a
> >> custom ArgumentError in one part of the cod
On Fri, 28 Jun 2013 18:36:37 -0700, Ethan Furman wrote:
> On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
>>
>> [rant]
>> I think it is lousy design for a framework like argparse to raise a
>> custom ArgumentError in one part of the code, only to catch it
>> elsewhere and call sys.exit. At the very
On 6/29/2013 12:12 AM, rusi wrote:
On Saturday, June 29, 2013 7:06:37 AM UTC+5:30, Ethan Furman wrote:
On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
[rant]
I think it is lousy design for a framework like argparse to raise a
custom ArgumentError in one part of the code, only to catch it elsewhe
On Sat, Jun 29, 2013 at 9:36 AM, Ethan Furman wrote:
> On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
>
>>
>> Libraries should not call sys.exit, or raise SystemExit. Whether to quit
>> or not is not the library's decision to make, that decision belongs to
>> the application layer. Yes, the appli
On Saturday, June 29, 2013 7:06:37 AM UTC+5:30, Ethan Furman wrote:
> On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
> > [rant]
> > I think it is lousy design for a framework like argparse to raise a
> > custom ArgumentError in one part of the code, only to catch it elsewhere
> > and call sys.exit.
Have you looked into docopt?
-Modulok-
On Fri, Jun 28, 2013 at 7:36 PM, Ethan Furman wrote:
> On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
>
>>
>> [rant]
>> I think it is lousy design for a framework like argparse to raise a
>> custom ArgumentError in one part of the code, only to catch it e
On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
[rant]
I think it is lousy design for a framework like argparse to raise a
custom ArgumentError in one part of the code, only to catch it elsewhere
and call sys.exit. At the very least, that ought to be a config option,
and off by default.
Librarie
After getting over the hurdles I initially explained and moving forward, I've
found that standard command-line parsing and its conventions
are far too ingrained in the design of argparse to make it useful as a general
command parser. I think I would end up overriding a
substantial amount of the m
I appreciate the responses from everyone. I knew I couldn't be the only who
thought this behavior was unnecessarily limiting.
I found a ticket on the bug tracker. A patch was even submitted, but obviously
it didn't make it into 3.3.
Hopefully, it will make it into 3.4 with some prodding.
http://
On Thu, Jun 27, 2013 at 8:22 PM, Tim Chase wrote:
> On 2013-06-28 09:02, Cameron Simpson wrote:
> > On 27Jun2013 11:50, Ethan Furman wrote:
> > | If the OP is writing an interactive shell, shouldn't `cmd` be used
> > | instead of `argparse`? argparse is, after all, intended for
> > | argument pa
On 2013-06-28 09:02, Cameron Simpson wrote:
> On 27Jun2013 11:50, Ethan Furman wrote:
> | If the OP is writing an interactive shell, shouldn't `cmd` be used
> | instead of `argparse`? argparse is, after all, intended for
> | argument parsing of command line scripts, not for interactive
> work.
>
On 27 June 2013 22:30, Jason Swails wrote:
>
> An alternative is, of course, to simply subclass ArgumentParser and copy
> over all of the code that catches an ArgumentError to eliminate the internal
> exception handling and instead allow them to propagate the call stack.
I would think it easier t
On 27Jun2013 22:49, Steven D'Aprano
wrote:
| [rant]
| I think it is lousy design for a framework like argparse to raise a
| custom ArgumentError in one part of the code, only to catch it elsewhere
| and call sys.exit. At the very least, that ought to be a config option,
| and off by default.
|
On 27Jun2013 11:50, Ethan Furman wrote:
| If the OP is writing an interactive shell, shouldn't `cmd` be used
| instead of `argparse`? argparse is, after all, intended for
| argument parsing of command line scripts, not for interactive work.
This is specious.
I invoke command line scripts intera
On Thu, 27 Jun 2013 12:02:22 -0400, Dave Angel wrote:
> On 06/27/2013 09:49 AM, Andrew Berg wrote:
>> On 2013.06.27 08:08, Roy Smith wrote:
>>> Can you give us a concrete example of what you're trying to do?
>> The actual code I've written so far isn't easily condensed into a short
>> simple snipp
On Fri, Jun 28, 2013 at 8:19 AM, Grant Edwards wrote:
> On 2013-06-27, Jason Swails wrote:
>
>> He _is_ using cmd. He's subclassed cmd.Cmd and trying to use
>> argparse to handle argument parsing in the Cmd.precmd method to
>> preprocess the user input.
>
> [...]
>
>> Having subclassed cmd.Cmd m
On 2013-06-27, Jason Swails wrote:
> He _is_ using cmd. He's subclassed cmd.Cmd and trying to use
> argparse to handle argument parsing in the Cmd.precmd method to
> preprocess the user input.
[...]
> Having subclassed cmd.Cmd myself in one of my programs and written my
> own argument parsing
On Thu, Jun 27, 2013 at 2:50 PM, Ethan Furman wrote:
>
> If the OP is writing an interactive shell, shouldn't `cmd` be used instead
> of `argparse`? argparse is, after all, intended for argument parsing of
> command line scripts, not for interactive work.
>
He _is_ using cmd. He's subclassed c
On 2013-06-27 17:02, Dave Angel wrote:
On 06/27/2013 09:49 AM, Andrew Berg wrote:
On 2013.06.27 08:08, Roy Smith wrote:
Can you give us a concrete example of what you're trying to do?
The actual code I've written so far isn't easily condensed into a short simple
snippet.
I'm trying to use argp
On 06/27/2013 11:39 AM, Terry Reedy wrote:
On 6/27/2013 2:18 PM, Dave Angel wrote:
On 06/27/2013 02:05 PM, Terry Reedy wrote:
On 6/27/2013 8:54 AM, Andrew Berg wrote:
I've begun writing a program with an interactive prompt, and it needs
to parse input from the user. I thought the argparse mod
On 6/27/2013 2:18 PM, Dave Angel wrote:
On 06/27/2013 02:05 PM, Terry Reedy wrote:
On 6/27/2013 8:54 AM, Andrew Berg wrote:
I've begun writing a program with an interactive prompt, and it needs
to parse input from the user. I thought the argparse module would be
great for this,
It is outside
On 06/27/2013 02:05 PM, Terry Reedy wrote:
On 6/27/2013 8:54 AM, Andrew Berg wrote:
I've begun writing a program with an interactive prompt, and it needs
to parse input from the user. I thought the argparse module would be
great for this,
It is outside argparse's intended domain of applicatio
On 6/27/2013 8:54 AM, Andrew Berg wrote:
I've begun writing a program with an interactive prompt, and it needs
to parse input from the user. I thought the argparse module would be
great for this,
It is outside argparse's intended domain of application -- parsing
command line arguments. The gr
On 06/27/2013 09:49 AM, Andrew Berg wrote:
On 2013.06.27 08:08, Roy Smith wrote:
Can you give us a concrete example of what you're trying to do?
The actual code I've written so far isn't easily condensed into a short simple
snippet.
I'm trying to use argparse to handle all the little details o
On 2013.06.27 08:08, Roy Smith wrote:
> Can you give us a concrete example of what you're trying to do?
The actual code I've written so far isn't easily condensed into a short simple
snippet.
I'm trying to use argparse to handle all the little details of parsing and
verifying arguments in the pre
In article ,
Andrew Berg wrote:
> I've begun writing a program with an interactive prompt, and it needs to
> parse input from the user. I thought the argparse module would be
> great for this, but unfortunately it insists on calling sys.exit() at any
> sign of trouble instead of letting its Ar
On 27 June 2013 13:54, Andrew Berg wrote:
> I've begun writing a program with an interactive prompt, and it needs to
> parse input from the user. I thought the argparse module would be
> great for this, but unfortunately it insists on calling sys.exit() at any
> sign of trouble instead of lettin
I've begun writing a program with an interactive prompt, and it needs to parse
input from the user. I thought the argparse module would be
great for this, but unfortunately it insists on calling sys.exit() at any sign
of trouble instead of letting its ArgumentError exception
propagate so that I c
32 matches
Mail list logo