diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-12-12 15:42:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-12-12 15:42:38 +0000 |
commit | bea2635be022e272ddac349f5e396ec901fc37e5 (patch) | |
tree | 24dbe11c9d462ff55f9b3af4b4da4cd1ae02e8a3 /sqlglot/helper.py | |
parent | Releasing debian version 10.1.3-1. (diff) | |
download | sqlglot-bea2635be022e272ddac349f5e396ec901fc37e5.tar.xz sqlglot-bea2635be022e272ddac349f5e396ec901fc37e5.zip |
Merging upstream version 10.2.6.
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 8c5808d..ed37e6c 100644 --- a/sqlglot/helper.py +++ b/sqlglot/helper.py @@ -385,3 +385,11 @@ def dict_depth(d: t.Dict) -> int: except StopIteration: # d.values() returns an empty sequence return 1 + + +def first(it: t.Iterable[T]) -> T: + """Returns the first element from an iterable. + + Useful for sets. + """ + return next(i for i in it) |