[issue13922] argparse handling multiple "--" in args improperly

Eric V. Smith report at bugs.python.org
Sun Mar 18 19:30:44 CET 2012


Eric V. Smith <eric at trueblade.com> added the comment:

No. parse_known_args assumes you have known and unknown args intermixed. 

Going back to the original example, what if "hack" and ":target" had overlapping parameter names (say, they both supported "--arg1")? I think parse_known_args would pick up all instances of "--arg1". I really want "--" to mean "treat everything else as non-optional arguments".

Whether that's the original intent, I don't know. But as David says, unless it is, it's impossible to implement such a scheme with argparse.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13922>
_______________________________________


More information about the Python-bugs-list mailing list