MCPcopy Index your code
hub / github.com/nodejs/node / iter_fields

Method iter_fields

tools/inspector_protocol/jinja2/nodes.py:148–162  ·  view source on GitHub ↗

This method iterates over all fields that are defined and yields ``(key, value)`` tuples. Per default all fields are returned, but it's possible to limit that to some fields by providing the `only` parameter or to exclude some using the `exclude` parameter. Both sho

(self, exclude=None, only=None)

Source from the content-addressed store, hash-verified

146 next(iter(attributes)))
147
148 def iter_fields(self, exclude=None, only=None):
149 """This method iterates over all fields that are defined and yields
150 ``(key, value)`` tuples. Per default all fields are returned, but
151 it's possible to limit that to some fields by providing the `only`
152 parameter or to exclude some using the `exclude` parameter. Both
153 should be sets or tuples of field names.
154 """
155 for name in self.fields:
156 if (exclude is only is None) or \
157 (exclude is not None and name not in exclude) or \
158 (only is not None and name in only):
159 try:
160 yield name, getattr(self, name)
161 except AttributeError:
162 pass
163
164 def iter_child_nodes(self, exclude=None, only=None):
165 """Iterates over all direct child nodes of the node. This iterates

Callers 3

iter_child_nodesMethod · 0.95
__eq__Method · 0.95
generic_visitMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected