[issue14191] argparse doesn't allow optionals within positionals
paul j3 added the comment: This is a revision of the test_intermixed.py that I submitted earlier. Now `parse_intermixed_args` acts like `parse_args', and calls `parse_known_intermixed_args`. Again it is form that can exercise the idea without modifying `argparse.py`. If the parser has incompatible features (REMAINDER, PARSER, or certain exclusive groups), it raises an error. However to facilitate testing I included a `_fallback` backdoor. If not default None it will be called instead of raising the error. While making documentation changes, I got to wondering whether 'interspersed' would be a better term than 'intermixed'. optparse has an 'interspersed' option and api. However the getopt documentation does use 'intermixed'. ---------- Added file: http://bugs.python.org/file30159/test_intermixed.py _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14191> _______________________________________
participants (1)
-
paul j3