def dispatch_ordered_sequence(self, node):
for (index, item) in enumerate(node):
yield (item, node, index, IndexPath)
- yield from self(item)
@dispatcher.Hook(set, frozenset)
def dispatch_unordered_sequence(self, node):
for item in node:
yield (item, node, item, HashPath)
- yield from self(item)
@dispatcher.Hook(dataclasses.is_dataclass)
def dispatch_dataclass(self, node):
key = field.name
value = getattr(node, key)
yield (value, node, key, AttributePath)
- yield from self(value)
@dispatcher.Hook(dict)
def dispatch_mapping(self, node):
for (key, value) in node.items():
yield (key, node, key, HashPath)
- yield from self(key)
yield (value, node, key, IndexPath)
- yield from self(value)
@dispatcher.Hook(object)
- def dispatch_object(self, node, path=()):
+ def dispatch_object(self, node):
yield from ()