Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49355

Re: Why is the argparse module so inflexible?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!news2.euro.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <oscar.j.benjamin@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.016
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'propagate': 0.09; 'stack.': 0.09; 'subject:Why': 0.09; 'subject:module': 0.09; 'cc:addr:python-list': 0.11; 'cc:name:python list': 0.16; 'subclass': 0.16; 'subject:argparse': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'handling': 0.26; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'easier': 0.31; 'subject:the': 0.34; 'received:google.com': 0.35; 'subject:?': 0.36; 'jason': 0.38; 'simply': 0.61; 'to:addr:gmail.com': 0.65; 'oscar': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=RDroHH0ie6S4JUYGldfDa0Vo8Eyd5D6Jr4m6yPR575U=; b=fVEQi/peEV2Ox0m6qlvp5wyCtxBRVGbGZzDqGnLSatGEuNScxKZ5MUO5XKinvIeBJ1 7YTWv1RgT/xOQue8Ac4T56GJMt+uLUnPa9lHURjo3e8XqM3UUNhu3tK6CqDXcxUx8QJJ HgHNTT2vr4wbcmpplQJfIdAS4azySBJmMlEyMbPbkNBlRyxisVxQJly/qnVGBsXZcsnF +2oLgqGexx1UHfJwRGi4SZaWBiFb/OHRqJ5JhxnoYI8cvvXNVZqLyHOVb6vPuxCHFvX6 FkA5j50J0/cCvJElrhw7Pv78+4dd30m8bOlMelcsRGbDVXWYtTSWkys0MNeYqq/2oL0l UCSQ==
X-Received by 10.220.168.7 with SMTP id s7mr4580943vcy.4.1372379046642; Thu, 27 Jun 2013 17:24:06 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <CAEk9e3qrdPfW3rJaAGRUimUDa6o5mJp9ODA1fkroLQKopGUKRw@mail.gmail.com>
References <51CC35F4.3040609@gmail.com> <kqhusi$je5$1@ger.gmane.org> <51CC8205.5060906@davea.name> <kqi0s8$a5d$1@ger.gmane.org> <51CC897E.5000702@stoneleaf.us> <CAEk9e3qrdPfW3rJaAGRUimUDa6o5mJp9ODA1fkroLQKopGUKRw@mail.gmail.com>
From Oscar Benjamin <oscar.j.benjamin@gmail.com>
Date Fri, 28 Jun 2013 01:23:46 +0100
Subject Re: Why is the argparse module so inflexible?
To Jason Swails <jason.swails@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Cc python list <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3947.1372379054.3114.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1372379054 news.xs4all.nl 15983 [2001:888:2000:d::a6]:51664
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:49355

Show key headers only | View raw


On 27 June 2013 22:30, Jason Swails <jason.swails@gmail.com> 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 to wrap getopt than monkey-patch argparse in this way.


Oscar

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Why is the argparse module so inflexible? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-06-28 01:23 +0100

csiph-web