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 paul.j3
Recipients Andrei.Vereha, Radu.Ciorba, Sam.Breese, bethard, idank, paul.j3, r.david.murray
Date 2013-04-17.22:38:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
parser = argparse.ArgumentParser()

I think you want these 3 cases to produce the same output:

    (Namespace(known=True), ['-u'])

With the attached patch, '-ku' produces the same result as '-k -u'. Instead of raising the "ignored explicit argument 'u'" error, if puts '-u' in the 'extras' list.  'parse_args' then raises a "error: unrecognized arguments: u" error.

That's an easy change, and does not break anything in the '' file.  But keep in mind that this test file mostly uses 'parse_args', and usually it ignores the failure messages.

Getting '-uk' to work this way would be much harder.  While it isn't obvious from the documentation, '-uk' is a valid option string, and '-u' is a valid abbreviation. Notice in of the documentation, the difference between long and short options is based on the number of characters, not whether there it starts with '-' or '--'.  So identifying what is wrong with '-uk' would require ambiguous reasoning.

I wonder what optparse does.
Date User Action Args
2013-04-17 22:38:07paul.j3setrecipients: + paul.j3, bethard, r.david.murray, idank, Sam.Breese, Radu.Ciorba, Andrei.Vereha
2013-04-17 22:38:07paul.j3setmessageid: <>
2013-04-17 22:38:07paul.j3linkissue16142 messages
2013-04-17 22:38:07paul.j3create