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

Method _extend

Tools/c-analyzer/c_parser/info.py:1606–1628  ·  view source on GitHub ↗
(self, decls)

Source from the content-addressed store, hash-verified

1604 self._decls[key] = decl
1605
1606 def _extend(self, decls):
1607 decls = iter(decls)
1608 # Check only the first item.
1609 for decl in decls:
1610 if isinstance(decl, Declaration):
1611 self._add_decl(decl)
1612 # Add the rest without checking.
1613 for decl in decls:
1614 self._add_decl(decl)
1615 elif isinstance(decl, HighlevelParsedItem):
1616 raise NotImplementedError(decl)
1617 else:
1618 try:
1619 key, decl = decl
1620 except ValueError:
1621 raise NotImplementedError(decl)
1622 if not isinstance(decl, Declaration):
1623 raise NotImplementedError(decl)
1624 self._add_decl(decl, key)
1625 # Add the rest without checking.
1626 for key, decl in decls:
1627 self._add_decl(decl, key)
1628 # The iterator will be exhausted at this point.

Callers 1

__init__Method · 0.95

Calls 1

_add_declMethod · 0.95

Tested by

no test coverage detected