We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
property
1 parent cb87f92 commit 4d554cdCopy full SHA for 4d554cd
w3/python/core/fundamental_interface/Node.py
@@ -175,13 +175,15 @@ def _init_child_nodes(self,
175
else:
176
self._child_nodes = NodeList(iter(child_nodes))
177
178
+ @property
179
def first_child(self) -> Optional[_AnyNode]:
180
"""The first child of this node. If there is no such node, this returns `None`.
181
"""
182
if not self.child_nodes:
183
return None
184
return self.child_nodes.item(0)
185
186
187
def last_child(self) -> Optional[_AnyNode]:
188
"""The last child of this node. If there is no such node, this returns `None`.
189
0 commit comments