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.
Created on 2012年12月05日 13:28 by Michael.Edwards, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test.py | Michael.Edwards, 2012年12月05日 13:28 | |||
| Messages (4) | |||
|---|---|---|---|
| msg176981 - (view) | Author: Michael Edwards (Michael.Edwards) | Date: 2012年12月05日 13:28 | |
When running parse_args, ArgumentParser is liberal in accepting parameters. Partial matches will be accepted as arguments (in the included example, --test bob, --tester bob, --testers bob all set the testers argument) Perhaps this is documented, but it was super unexpected for me. |
|||
| msg176986 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年12月05日 13:48 | |
It is both documented (http://docs.python.org/dev/library/argparse.html#argument-abbreviations) and an important feature. I thought there was an enhancement request in this tracker for making the behavior optional, but I couldn't find it when I looked, so I'm turning this into one. If someone finds that there is already another issue this one can be closed as a dup. I'm marking it low priority, though, because I think most people want the ability to abbreviate the option names. |
|||
| msg176995 - (view) | Author: Chris Jerdonek (chris.jerdonek) * (Python committer) | Date: 2012年12月05日 17:49 | |
David, is issue 14910 the one you were thinking of? |
|||
| msg176997 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年12月05日 18:45 | |
It is indeed. And it even has a patch. Don't know how I missed it. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:39 | admin | set | github: 60818 |
| 2012年12月08日 05:32:22 | terry.reedy | set | status: open -> closed |
| 2012年12月05日 18:45:51 | r.david.murray | set | superseder: argparse: disable abbreviation resolution: duplicate messages: + msg176997 stage: needs patch -> resolved |
| 2012年12月05日 17:49:49 | chris.jerdonek | set | nosy:
+ chris.jerdonek messages: + msg176995 |
| 2012年12月05日 13:48:48 | r.david.murray | set | priority: normal -> low type: enhancement versions: + Python 3.4, - Python 2.7 keywords: + easy nosy: + bethard, r.david.murray title: argparse accepts partial parameters -> argparse should have an option to require un-abbreviated option names messages: + msg176986 stage: needs patch |
| 2012年12月05日 13:28:07 | Michael.Edwards | create | |