Steven Bethard <steven.beth...@gmail.com> added the comment:

I still disagree. You're giving the parser ambiguous input. If a parser sees 
"--foo --bar", and "--foo" is a valid option, but "--bar" is not, this is a 
legitimately ambiguous situation. Either the user really wanted "--bar", and 
the parser doesn't support it, or the "--bar" was meant to be the argument to 
the "--foo" flag. At this point, the parser must make an arbitrary decision, 
and argparse chooses the interpretation that the user wanted the "--bar" flag.

I understand that you have a good use case for the other interpretation. That's 
why I suggest you come up with a patch that allows this other interpretation to 
be enabled when necessary. Changing the default behavior is really a 
non-starter unless you can propose a sensible transition strategy (as is always 
necessary for changing APIs in backwards incompatible ways).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9334>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to