diff --git a/_delb/utils.py b/_delb/utils.py index 4fcd1ce5..7482380a 100644 --- a/_delb/utils.py +++ b/_delb/utils.py @@ -361,7 +361,7 @@ def _random_unused_prefix(namespaces: etree._NSMap) -> str: ) -def sort_nodes_in_document_order(nodes: Iterable[NodeBase]) -> Iterator[NodeBase]: +def _sort_nodes_in_document_order(nodes: Iterable[NodeBase]) -> Iterator[NodeBase]: node_index_cache: dict[int, int] = {} sorter = _NodesSorter() for node in nodes: @@ -429,5 +429,5 @@ def traverse_df_ltr_ttb(root: NodeBase, *filters: Filter) -> Iterator[NodeBase]: first.__name__, get_traverser.__name__, last.__name__, - sort_nodes_in_document_order.__name__, + _sort_nodes_in_document_order.__name__, ) diff --git a/_delb/xpath/__init__.py b/_delb/xpath/__init__.py index 13acc5b3..51aef443 100644 --- a/_delb/xpath/__init__.py +++ b/_delb/xpath/__init__.py @@ -72,7 +72,7 @@ from cssselect import GenericTranslator from _delb.names import Namespaces -from _delb.utils import sort_nodes_in_document_order +from _delb.utils import _sort_nodes_in_document_order from _delb.xpath.ast import EvaluationContext from _delb.xpath import functions # noqa: F401 from _delb.xpath.parser import parse @@ -141,7 +141,7 @@ def in_document_order(self) -> QueryResults: Returns another :class:`QueryResults` instance where the contained nodes are sorted in document order. """ - return QueryResults(sort_nodes_in_document_order(self)) + return QueryResults(_sort_nodes_in_document_order(self)) @property def last(self) -> Optional[NodeBase]: