Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions treelib/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ def size(self, level=None):
raise TypeError(
"level should be an integer instead of '%s'" % type(level))

def subtree(self, nid, identifier=None):
def subtree(self, nid, identifier=None, *args, **kwargs):
"""
Return a shallow COPY of subtree with nid being the new root.
If nid is None, return an empty tree.
Expand All @@ -884,7 +884,7 @@ def subtree(self, nid, identifier=None):
raise NodeIDAbsentError("Node '%s' is not in the tree" % nid)

st.root = nid
for node_n in self.expand_tree(nid):
for node_n in self.expand_tree(nid, *args, **kwargs):
st._nodes.update({self[node_n].identifier: self[node_n]})
# define nodes parent/children in this tree
# all pointers are the same as copied tree, except the root
Expand Down