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: 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: References: <51CC35F4.3040609@gmail.com> <51CC8205.5060906@davea.name> <51CC897E.5000702@stoneleaf.us> From: Oscar Benjamin Date: Fri, 28 Jun 2013 01:23:46 +0100 Subject: Re: Why is the argparse module so inflexible? To: Jason Swails Content-Type: text/plain; charset=ISO-8859-1 Cc: python list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 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 to wrap getopt than monkey-patch argparse in this way. Oscar