-
-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
It seems the children are set as a list, but are returned as a tuple.
I think it would make more sense to set/get it as the same type, probably a tuple.
It makes the following (no-op looking) code illegal:
node = Node("node")
node.children = node.children
# => TypeError: Children input should be list type, received input type <class 'tuple'>It's risky too, because of the following:
root = Node("root")
mutable_children = list(map(Node, "abc"))
root.children = mutable_children
c = mutable_children.pop()
print(root.children) # => (Node(/root/a, ), Node(/root/b, ))
print(c.parent) # => Node(/root, )
raise ZeroDivisionErrorMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working