Add a docstring for TreeNode.__init__

This commit is contained in:
Dave Pearson
2023-03-01 13:26:27 +00:00
parent dbb52637c5
commit 3192ee7402

View File

@@ -84,6 +84,17 @@ class TreeNode(Generic[TreeDataType]):
expanded: bool = True,
allow_expand: bool = True,
) -> None:
"""Initialise the node.
Args:
tree: The tree that the node is being attached to.
parent: The parent node that this node is being attached to.
id: The ID of the node.
label: The label for the node.
data: Optional data to associate with the node.
expand: Should the node be attached in an expanded state?
allow_expand: Should the node allow being expanded by the user?
"""
self._tree = tree
self._parent = parent
self._id = id