fix: revert _get_by_id to private

This commit is contained in:
Aaron Stephens
2022-11-24 22:36:25 -08:00
parent 710c69d3af
commit 04246aebbb
2 changed files with 2 additions and 2 deletions

View File

@@ -63,7 +63,7 @@ class NodeList(Sequence):
"""
return self._nodes.index(widget)
def get_by_id(self, widget_id: str) -> Widget | None:
def _get_by_id(self, widget_id: str) -> Widget | None:
"""Get the widget for the given widget_id, or None if there's no matches in this list"""
return self._nodes_by_id.get(widget_id)

View File

@@ -365,7 +365,7 @@ class Widget(DOMNode):
NoMatches: if no children could be found for this ID
WrongType: if the wrong type was found.
"""
child = self.children.get_by_id(id)
child = self.children._get_by_id(id)
if child is None:
raise NoMatches(f"No child found with id={id!r}")
if expect_type is None: