Message111669
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). |
|
Date |
User |
Action |
Args |
2010-07-26 21:53:50 | bethard | set | recipients:
+ bethard, eric.smith, r.david.murray, andersk, gdb, nelhage |
2010-07-26 21:53:50 | bethard | set | messageid: <1280181230.38.0.810079356117.issue9334@psf.upfronthosting.co.za> |
2010-07-26 21:53:48 | bethard | link | issue9334 messages |
2010-07-26 21:53:48 | bethard | create | |
|