You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: