diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-10-16 11:37:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-10-16 11:37:35 +0000 |
commit | 45eab59f38aae326a4970767f9bc7119bef339b9 (patch) | |
tree | f5a21c1bba9fd891c923cc14206986691931ca47 /sqlglot/helper.py | |
parent | Adding upstream version 18.11.6. (diff) | |
download | sqlglot-db4da087445194e861fe774f24444394ceeb380f.tar.xz sqlglot-db4da087445194e861fe774f24444394ceeb380f.zip |
Adding upstream version 18.13.0.upstream/18.13.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/helper.py')
-rw-r--r-- | sqlglot/helper.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sqlglot/helper.py b/sqlglot/helper.py index 00d49ae..74b61e3 100644 --- a/sqlglot/helper.py +++ b/sqlglot/helper.py @@ -441,6 +441,14 @@ def first(it: t.Iterable[T]) -> T: def merge_ranges(ranges: t.List[t.Tuple[A, A]]) -> t.List[t.Tuple[A, A]]: + """ + Merges a sequence of ranges, represented as tuples (low, high) whose values + belong to some totally-ordered set. + + Example: + >>> merge_ranges([(1, 3), (2, 6)]) + [(1, 6)] + """ if not ranges: return [] |