This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author py.user
Recipients paul.j3, py.user
Date 2015-06-22.23:14:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1435014896.45.0.313921723311.issue24419@psf.upfronthosting.co.za>
In-reply-to
Content
Tested on argdest.py:

#!/usr/bin/env python3

import argparse

parser = argparse.ArgumentParser()
parser.add_argument('x', action='append')
parser.add_argument('x', action='append_const', const=42, metavar='foo')
parser.add_argument('x', action='append_const', const=43, metavar='bar')
parser.add_argument('-x', action='append_const', const=44)

args = parser.parse_args()
print(args)


Run:

[guest@localhost debug]$ ./argdest.py -h
usage: argdest.py [-h] [-x] x

positional arguments:
  x
  foo
  bar

optional arguments:
  -h, --help  show this help message and exit
  -x
[guest@localhost debug]$ ./argdest.py -x 1 -x
Namespace(x=[44, '1', 42, 43, 44])
[guest@localhost debug]$


LGTM.
History
Date User Action Args
2015-06-22 23:14:56py.usersetrecipients: + py.user, paul.j3
2015-06-22 23:14:56py.usersetmessageid: <1435014896.45.0.313921723311.issue24419@psf.upfronthosting.co.za>
2015-06-22 23:14:56py.userlinkissue24419 messages
2015-06-22 23:14:56py.usercreate