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

Method _add_action

Lib/argparse.py:1571–1590  ·  view source on GitHub ↗
(self, action)

Source from the content-addressed store, hash-verified

1569 return group
1570
1571 def _add_action(self, action):
1572 # resolve any conflicts
1573 self._check_conflict(action)
1574
1575 # add to actions list
1576 self._actions.append(action)
1577 action.container = self
1578
1579 # index the action by any option strings it has
1580 for option_string in action.option_strings:
1581 self._option_string_actions[option_string] = action
1582
1583 # set the flag if any option strings look like negative numbers
1584 for option_string in action.option_strings:
1585 if self._negative_number_matcher.match(option_string):
1586 if not self._has_negative_number_optionals:
1587 self._has_negative_number_optionals.append(True)
1588
1589 # return the created action
1590 return action
1591
1592 def _remove_action(self, action):
1593 self._actions.remove(action)

Callers 1

add_argumentMethod · 0.95

Calls 3

_check_conflictMethod · 0.95
appendMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected