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 bethard
Recipients andersk, bethard, eric.smith, gdb, nelhage, r.david.murray
Date 2010-07-26.21:53:48
SpamBayes Score 0.0024256047
Marked as misclassified No
Message-id <1280181230.38.0.810079356117.issue9334@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2010-07-26 21:53:50bethardsetrecipients: + bethard, eric.smith, r.david.murray, andersk, gdb, nelhage
2010-07-26 21:53:50bethardsetmessageid: <1280181230.38.0.810079356117.issue9334@psf.upfronthosting.co.za>
2010-07-26 21:53:48bethardlinkissue9334 messages
2010-07-26 21:53:48bethardcreate