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


Groups > comp.lang.python > #49369

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!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <robotsondrugs@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'cpython': 0.05; 'conventions': 0.07; 'optparse': 0.09; 'parsing': 0.09; 'subject:Why': 0.09; 'subject:module': 0.09; 'windows': 0.15; 'command-line': 0.16; 'deprecated,': 0.16; 'overriding': 0.16; 'parser.': 0.16; 'sought': 0.16; 'subject:argparse': 0.16; 'module': 0.19; 'command': 0.22; 'header:User-Agent:1': 0.23; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'getting': 0.31; 'another.': 0.31; 'explained': 0.31; 'probably': 0.32; 'subject:the': 0.34; 'received:google.com': 0.35; 'really': 0.36; 'useful': 0.36; 'subject:?': 0.36; 'too': 0.37; 'message- id:@gmail.com': 0.38; 'initially': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'moving': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; '9.1': 0.84; 'forward,': 0.84; 'freebsd': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=P2TmPDKwZ6GwS4wSSGZZmdqaxdKbEW9LWO+p3Nio2lk=; b=mynI4ONTy6yj+oK3fg+XX/Hy9DxDVqhedGHl13QM+FsvPeU7JM428asjqD1tHl13hy sKgpphz2ym5Q6LZKh4qSVt2QxVKfU8y6+hFvXW0Da+2hzoWmBBfhIbs0GSBjv0nZLmoy SCSklS2ofXnyHVBSw6pCeetup7eezwOX5qBr8HO3vMfn6FTQDVafVpcbahAC6C0iuSAP 1PY+Yu9glmSyybpB+S9SCIsK95iXOxud9t8Bm32xQD3Chc97dlJWo9cax6NZYuCa3yZr CKbLdKlarrRM7i3at4J1mdiGnZeYTS80CeyKpQ2tEBZ2HrSu0+luBZtQ7ZB/EEJ9hNo6 0D1w==
X-Received by 10.50.82.98 with SMTP id h2mr3127979igy.33.1372417096360; Fri, 28 Jun 2013 03:58:16 -0700 (PDT)
Date Fri, 28 Jun 2013 05:57:32 -0500
From Andrew Berg <robotsondrugs@gmail.com>
User-Agent Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
MIME-Version 1.0
To python-list@python.org
Subject Re: Why is the argparse module so inflexible?
References <51CC897E.5000702@stoneleaf.us> <20130627230213.GA22992@cskk.homeip.net> <20130627192221.19949fa6@bigbox.christie.dr> <CAEk9e3rZwWCJbZaTfBnDpKyaD4o4UhMbGZCBm2hZgtmqLu7aDQ@mail.gmail.com> <51CD12DE.7030802@gmail.com>
In-Reply-To <51CD12DE.7030802@gmail.com>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
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.3955.1372417105.3114.python-list@python.org> (permalink)
Lines 8
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1372417105 news.xs4all.nl 16005 [2001:888:2000:d::a6]:36119
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:49369

Show key headers only | View raw


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 module to make it do what I want, and I would really rather not try to shoehorn one paradigm into another.
Unfortunately, getopt provides none of the benefits I sought with argparse, and optparse is deprecated, so I will probably be rolling my own
custom parser.

-- 
CPython 3.3.2 | Windows NT 6.2.9200 / FreeBSD 9.1

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


Thread

Re: Why is the argparse module so inflexible? Andrew Berg <robotsondrugs@gmail.com> - 2013-06-28 05:57 -0500

csiph-web