diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 05:38:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 05:38:43 +0000 |
commit | 1dd702b721f7d1836af27c8a114f1386ff9f57bd (patch) | |
tree | 622a84466e38b4480dbbbdfa64263da19d736e2f /port_for/utils.py | |
parent | Adding upstream version 0.7.1. (diff) | |
download | port-for-upstream/0.7.2.tar.xz port-for-upstream/0.7.2.zip |
Adding upstream version 0.7.2.upstream/0.7.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'port_for/utils.py')
-rw-r--r-- | port_for/utils.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/port_for/utils.py b/port_for/utils.py index 361d5c0..997f63a 100644 --- a/port_for/utils.py +++ b/port_for/utils.py @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- +"""Port for utils.""" import itertools -from typing import Iterable, Iterator, Tuple, Set +from typing import Iterable, Iterator, Set, Tuple def ranges_to_set(lst: Iterable[Tuple[int, int]]) -> Set[int]: - """ - Convert a list of ranges to a set of numbers:: + """Convert a list of ranges to a set of numbers. >>> ranges = [(1,3), (5,6)] >>> sorted(list(ranges_to_set(ranges))) @@ -16,8 +15,7 @@ def ranges_to_set(lst: Iterable[Tuple[int, int]]) -> Set[int]: def to_ranges(lst: Iterable[int]) -> Iterator[Tuple[int, int]]: - """ - Convert a list of numbers to a list of ranges:: + """Convert a list of numbers to a list of ranges. >>> numbers = [1,2,3,5,6] >>> list(to_ranges(numbers)) |