We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
is_ordered_subset
1 parent d0e68e3 commit ee46d8cCopy full SHA for ee46d8c
toponetx/utils/iterable.py
@@ -1,14 +1,11 @@
1
"""Module with iterable-related utility functions."""
2
3
from collections.abc import Sequence
4
-from typing import TypeVar
5
6
__all__ = ["is_ordered_subset"]
7
8
-T = TypeVar("T")
9
10
-
11
-def is_ordered_subset(one: Sequence[T], other: Sequence[T]) -> bool:
+def is_ordered_subset[T](one: Sequence[T], other: Sequence[T]) -> bool:
12
"""Return True if the first iterable is a subset of the second iterable.
13
14
This method is specifically optimized for ordered iterables to use return as early as possible for non-subsets.
0 commit comments