Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #18794
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <edriscoll@wisc.edu> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; '(using': 0.05; 'suppose': 0.05; 'version?': 0.07; 'content-type:multipart/signed': 0.09; 'filename:fname piece:signature': 0.09; 'wrappers': 0.09; 'api': 0.09; "*isn't*": 0.16; '--help': 0.16; 'content-type:application /pgp-signature': 0.16; 'filename:fname piece:asc': 0.16; 'filename:fname:signature.asc': 0.16; 'parser,': 0.16; 'retrieving': 0.16; 'stuff': 0.22; "doesn't": 0.22; 'asked': 0.22; 'thus': 0.23; '(though': 0.23; 'objects,': 0.23; 'code': 0.25; 'seem': 0.30; 'actual': 0.32; 'idea': 0.32; 'header:User-Agent:1': 0.33; 'this.': 0.33; 'there': 0.33; 'to:addr:python-list': 0.34; 'something': 0.35; 'subject:/': 0.35; '(for': 0.35; 'received:192': 0.37; 'options': 0.37; 'received:128': 0.37; 'could': 0.37; 'doing': 0.38; 'some': 0.38; 'received:192.168.0': 0.38; 'option': 0.39; "i'd": 0.39; 'either': 0.39; 'define': 0.39; 'to:addr:python.org': 0.40; 'might': 0.40; 'received:192.168': 0.40; 'miss': 0.62; 'took': 0.63 |
| Date | Tue, 10 Jan 2012 19:26:15 -0600 |
| From | Evan Driscoll <edriscoll@wisc.edu> |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Introspecting optparse/argparse objects |
| X-Enigmail-Version | 1.3.4 |
| Content-Type | multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig3812C88A8500B9C1FD7BDCD9" |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| 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.4620.1326245218.27778.python-list@python.org> (permalink) |
| Lines | 51 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1326245218 news.xs4all.nl 6884 [2001:888:2000:d::a6]:56835 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:18794 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
I'd like to be able to be able to define options and then look at the
lists. (For a concrete idea of a use case, suppose that it did not
directly support the --help option and I wanted to write code that took
its place.) Unfortunately, there doesn't seem to be any public API for
doing this.
Even if I were to do something like
options = [ make_option(...), make_option(...) ]
(using optparse) and could thus get a handle on the Option objects,
there doesn't seem to be a public API for retrieving stuff like the
actual options (though available via opt._short_opts and opt._long_opts).
This means that either I need to write my own wrappers around options,
option groups, and perhaps even an option parser, or I have to dig into
_variables _that _are _not _part _of _the _public _api. Both of those
choices are distasteful.
So,
1) Did I miss anything?
2) Is there some particular reason that this API *isn't* provided, and
if I asked for it I might get it in a future version?
Evan
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Introspecting optparse/argparse objects Evan Driscoll <edriscoll@wisc.edu> - 2012-01-10 19:26 -0600
Re: Introspecting optparse/argparse objects alex23 <wuwei23@gmail.com> - 2012-01-11 17:37 -0800
Re: Introspecting optparse/argparse objects Evan Driscoll <edriscoll@wisc.edu> - 2012-01-11 20:44 -0600
csiph-web