MCPcopy Index your code
hub / github.com/RustPython/RustPython / parse_known_intermixed_args

Method parse_known_intermixed_args

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

Source from the content-addressed store, hash-verified

2573 return args
2574
2575 def parse_known_intermixed_args(self, args=None, namespace=None):
2576 # returns a namespace and list of extras
2577 #
2578 # positional can be freely intermixed with optionals. optionals are
2579 # first parsed with all positional arguments deactivated. The 'extras'
2580 # are then parsed. If the parser definition is incompatible with the
2581 # intermixed assumptions (e.g. use of REMAINDER, subparsers) a
2582 # TypeError is raised.
2583
2584 positionals = self._get_positional_actions()
2585 a = [action for action in positionals
2586 if action.nargs in [PARSER, REMAINDER]]
2587 if a:
2588 raise TypeError('parse_intermixed_args: positional arg'
2589 ' with nargs=%s'%a[0].nargs)
2590
2591 return self._parse_known_args2(args, namespace, intermixed=True)
2592
2593 # ========================
2594 # 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