-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Hi,
Does it make sense to implement the "merge" method in the Node class based on the union of properties instead of concatenation of lists? This is the implementation that suits my problem:
def merge(self, other: 'Node'):
"""Merge the contents of a node into this node.
Used by Node.merge_trees()
"""
if not self.label and other.label:
self.label = other.label
#self.properties += other.properties
self.properties = [value for value in self.properties if value not in other.properties]
#self.directives += other.directives
self.directives = [value for value in self.directives if value not in other.directives]
self.children += other.children
Best regards,
Vitor
Metadata
Metadata
Assignees
Labels
No labels