Skip to content

Commit 59f56ba

Browse files
committed
Update parent_node parameters of Node.__init__ (#16)
the `parent_node` cannot be set directly on constructor. since the parent node should have self in its `child_nodes`. the binding of parent-child nodes can be done with `insert_before`, `append_child` methods.
1 parent fac414d commit 59f56ba

File tree

1 file changed

+2
-3
lines changed
  • w3/python/core/fundamental_interface

1 file changed

+2
-3
lines changed

w3/python/core/fundamental_interface/Node.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def __init__(self,
6565
node_type: NodeType,
6666
node_name: DOMString,
6767
node_value: Optional[DOMString] = None,
68-
parent_node: Optional[_AnyNode] = None,
6968
child_nodes: Optional[Iterable[_AnyNode]] = None,
7069
attributes: Optional[Iterable[_AnyNode]] = None,
7170
owner_document: Optional[_Document] = None,
@@ -76,7 +75,7 @@ def __init__(self,
7675
self._set_node_type(node_type)
7776
self._set_node_name(node_name)
7877
self._set_node_value(node_value)
79-
self._set_parent_node(parent_node)
78+
self._set_parent_node(None)
8079
self._init_child_nodes(child_nodes)
8180
self._init_attributes(attributes)
8281
self._set_owner_document(owner_document)
@@ -85,7 +84,7 @@ def __init__(self,
8584
self._node_type: NodeType
8685
self._node_name: DOMString
8786
self._node_value: DOMString
88-
self._parent_node: _AnyNode
87+
self._parent_node: Optional[_AnyNode]
8988
self._child_nodes: NodeList
9089
self._attributes: _NamedNodeMap
9190
self._owner_document: _Document

0 commit comments

Comments
 (0)