Message245659
| 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:56 | py.user | set | recipients:
+ py.user, paul.j3 |
| 2015年06月22日 23:14:56 | py.user | set | messageid: <1435014896.45.0.313921723311.issue24419@psf.upfronthosting.co.za> |
| 2015年06月22日 23:14:56 | py.user | link | issue24419 messages |
| 2015年06月22日 23:14:56 | py.user | create |
|