Message312185
| Author |
paul.j3 |
| Recipients |
akvadrako, bethard, chris.jerdonek, danielsh, paul.j3 |
| Date |
2018年02月14日.23:35:27 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1518651327.93.0.467229070634.issue17050@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
REMAINDER is not widely used, and probably was not tested thoroughly during development. It works for the example given in the docs.
A variant, argparse.PARSER ('A...') is widely used. This is, effectively, REMAINDER ('...') that requires an initial non-optional string. Sort of what '+' is to '*'.
I suspect REMAINDER is most reliable when used as nargs for an optional, e.g.
add_argument('--rest', nargs=argparse.REMAINDER)
That way it's clear to everyone, developer, user, and the parser that the following strings are to be taken is.
When parsing the command line, clarity should have priority over convenience. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2018年02月14日 23:35:27 | paul.j3 | set | recipients:
+ paul.j3, bethard, chris.jerdonek, danielsh, akvadrako |
| 2018年02月14日 23:35:27 | paul.j3 | set | messageid: <1518651327.93.0.467229070634.issue17050@psf.upfronthosting.co.za> |
| 2018年02月14日 23:35:27 | paul.j3 | link | issue17050 messages |
| 2018年02月14日 23:35:27 | paul.j3 | create |
|