[issue29030] argparse: choices override metavar

2020-12-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +22743 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23884 ___ Python tracker __

[issue29030] argparse: choices override metavar

2020-12-19 Thread Raymond Hettinger
Change by Raymond Hettinger : -- components: +Documentation -Library (Lib) versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.5 ___ Python tracker ___ ___

[issue29030] argparse: choices override metavar

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list maili

[issue29030] argparse: choices override metavar

2017-04-10 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> bethard nosy: +bethard ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue29030] argparse: choices override metavar

2017-04-09 Thread Martin Panter
Martin Panter added the comment: I think the documentation should be fixed to say choices overrides dest, and the implementation should be left alone. Even if the documentation is not a “formal module reference”, it should not be wrong or misleading. Also, Issue 14039 is related, about “metava

[issue29030] argparse: choices override metavar

2017-01-06 Thread paul j3
paul j3 added the comment: subparsers is an example of choices displaying as the metavar. From the documentation example: usage: PROG [-h] [--foo] {a,b} ... positional arguments: {a,b} sub-command help - To the main parser, the 'subparser' is a positional argument, with

[issue29030] argparse: choices override metavar

2017-01-06 Thread paul j3
paul j3 added the comment: Here's the method in HelpFormatter that creates the metavar: def _metavar_formatter(self, action, default_metavar): if action.metavar is not None: result = action.metavar elif action.choices is not None: choice_strs = [str(ch

[issue29030] argparse: choices override metavar

2016-12-20 Thread R. David Murray
R. David Murray added the comment: metavar is, I believe, the intended way to change the default behavior. Whether or not this needs better documentation is a separate question :) -- nosy: +r.david.murray ___ Python tracker

[issue29030] argparse: choices override metavar

2016-12-20 Thread Cyker Way
New submission from Cyker Way: Using `choices` option in `argparse` module caused unwanted behavior. # Without `choices` parser = argparse.ArgumentParser() parser.add_argument('length') parser.print_help() ## Output usage: demo.py [-h] length positional arguments: l