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

Method _get_positional_kwargs

Lib/argparse.py:1641–1656  ·  view source on GitHub ↗
(self, dest, **kwargs)

Source from the content-addressed store, hash-verified

1639 group_map.get(action, self)._add_action(action)
1640
1641 def _get_positional_kwargs(self, dest, **kwargs):
1642 # make sure required is not specified
1643 if 'required' in kwargs:
1644 msg = "'required' is an invalid argument for positionals"
1645 raise TypeError(msg)
1646
1647 # mark positional arguments as required if at least one is
1648 # always required
1649 nargs = kwargs.get('nargs')
1650 if nargs == 0:
1651 raise ValueError('nargs for positionals must be != 0')
1652 if nargs not in [OPTIONAL, ZERO_OR_MORE, REMAINDER, SUPPRESS]:
1653 kwargs['required'] = True
1654
1655 # return the keyword arguments with no option strings
1656 return dict(kwargs, dest=dest, option_strings=[])
1657
1658 def _get_optional_kwargs(self, *args, **kwargs):
1659 # determine short and long option strings

Callers 1

add_argumentMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected