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

Method __init__

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

Source from the content-addressed store, hash-verified

1491class _ActionsContainer(object):
1492
1493 def __init__(self,
1494 description,
1495 prefix_chars,
1496 argument_default,
1497 conflict_handler):
1498 super(_ActionsContainer, self).__init__()
1499
1500 self.description = description
1501 self.argument_default = argument_default
1502 self.prefix_chars = prefix_chars
1503 self.conflict_handler = conflict_handler
1504
1505 # set up registries
1506 self._registries = {}
1507
1508 # register actions
1509 self.register('action', None, _StoreAction)
1510 self.register('action', 'store', _StoreAction)
1511 self.register('action', 'store_const', _StoreConstAction)
1512 self.register('action', 'store_true', _StoreTrueAction)
1513 self.register('action', 'store_false', _StoreFalseAction)
1514 self.register('action', 'append', _AppendAction)
1515 self.register('action', 'append_const', _AppendConstAction)
1516 self.register('action', 'count', _CountAction)
1517 self.register('action', 'help', _HelpAction)
1518 self.register('action', 'version', _VersionAction)
1519 self.register('action', 'parsers', _SubParsersAction)
1520 self.register('action', 'extend', _ExtendAction)
1521
1522 # raise an exception if the conflict handler is invalid
1523 self._get_handler()
1524
1525 # action storage
1526 self._actions = []
1527 self._option_string_actions = {}
1528
1529 # groups
1530 self._action_groups = []
1531 self._mutually_exclusive_groups = []
1532
1533 # defaults storage
1534 self._defaults = {}
1535
1536 # determines whether an "option" looks like a negative number
1537 self._negative_number_matcher = _re.compile(r'-\.?\d')
1538
1539 # whether or not there are any optionals that look like negative
1540 # numbers -- uses a list so it can be shared and edited
1541 self._has_negative_number_optionals = []
1542
1543 # ====================
1544 # 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