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

Method __init__

Lib/argparse.py:1417–1465  ·  view source on GitHub ↗
(self,
                 description,
                 prefix_chars,
                 argument_default,
                 conflict_handler)

Source from the content-addressed store, hash-verified

1415class _ActionsContainer(object):
1416
1417 def __init__(self,
1418 description,
1419 prefix_chars,
1420 argument_default,
1421 conflict_handler):
1422 super(_ActionsContainer, self).__init__()
1423
1424 self.description = description
1425 self.argument_default = argument_default
1426 self.prefix_chars = prefix_chars
1427 self.conflict_handler = conflict_handler
1428
1429 # set up registries
1430 self._registries = {}
1431
1432 # register actions
1433 self.register('action', None, _StoreAction)
1434 self.register('action', 'store', _StoreAction)
1435 self.register('action', 'store_const', _StoreConstAction)
1436 self.register('action', 'store_true', _StoreTrueAction)
1437 self.register('action', 'store_false', _StoreFalseAction)
1438 self.register('action', 'append', _AppendAction)
1439 self.register('action', 'append_const', _AppendConstAction)
1440 self.register('action', 'count', _CountAction)
1441 self.register('action', 'help', _HelpAction)
1442 self.register('action', 'version', _VersionAction)
1443 self.register('action', 'parsers', _SubParsersAction)
1444 self.register('action', 'extend', _ExtendAction)
1445
1446 # raise an exception if the conflict handler is invalid
1447 self._get_handler()
1448
1449 # action storage
1450 self._actions = []
1451 self._option_string_actions = {}
1452
1453 # groups
1454 self._action_groups = []
1455 self._mutually_exclusive_groups = []
1456
1457 # defaults storage
1458 self._defaults = {}
1459
1460 # determines whether an "option" looks like a negative number
1461 self._negative_number_matcher = _re.compile(r'-\.?\d')
1462
1463 # whether or not there are any optionals that look like negative
1464 # numbers -- uses a list so it can be shared and edited
1465 self._has_negative_number_optionals = []
1466
1467 # ====================
1468 # Registration methods

Callers

nothing calls this directly

Calls 5

registerMethod · 0.95
_get_handlerMethod · 0.95
superClass · 0.85
__init__Method · 0.45
compileMethod · 0.45

Tested by

no test coverage detected