MCPcopy Index your code
hub / github.com/python/cpython / parse_known_intermixed_args

Method parse_known_intermixed_args

Lib/argparse.py:2657–2673  ·  view source on GitHub ↗
(self, args=None, namespace=None)

Source from the content-addressed store, hash-verified

2655 return args
2656
2657 def parse_known_intermixed_args(self, args=None, namespace=None):
2658 # returns a namespace and list of extras
2659 #
2660 # positional can be freely intermixed with optionals. optionals are
2661 # first parsed with all positional arguments deactivated. The 'extras'
2662 # are then parsed. If the parser definition is incompatible with the
2663 # intermixed assumptions (e.g. use of REMAINDER, subparsers) a
2664 # TypeError is raised.
2665
2666 positionals = self._get_positional_actions()
2667 a = [action for action in positionals
2668 if action.nargs in [PARSER, REMAINDER]]
2669 if a:
2670 raise TypeError('parse_intermixed_args: positional arg'
2671 ' with nargs=%s'%a[0].nargs)
2672
2673 return self._parse_known_args2(args, namespace, intermixed=True)
2674
2675 # ========================
2676 # Value conversion methods

Callers 2

parse_intermixed_argsMethod · 0.95
test_basicMethod · 0.95

Calls 2

_parse_known_args2Method · 0.95

Tested by 1

test_basicMethod · 0.76