Skip to content

Commit

Permalink
Marks utils._sort_nodes_in_document_order as private
Browse files Browse the repository at this point in the history
It's not fully implemented, suffices the internal requirements, and
no obvious other real-world use-case comes to mind.
  • Loading branch information
funkyfuture committed Jul 26, 2024
1 parent abc5528 commit fe5094b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions _delb/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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__,
)
4 changes: 2 additions & 2 deletions _delb/xpath/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]:
Expand Down

0 comments on commit fe5094b

Please sign in to comment.