Merging upstream version 10.2.6.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
40155883c5
commit
17f6b2c749
36 changed files with 1281 additions and 493 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue