tlslite.utils.lists module
Helper functions for handling lists
- tlslite.utils.lists.getFirstMatching(values, matches)[source]
Return the first element in
values
that is also inmatches
.Return None if values is None, empty or no element in values is also in matches.
- Parameters:
values (collections.abc.Iterable) – list of items to look through, can be None
matches (collections.abc.Container) – list of items to check against
- tlslite.utils.lists.to_str_delimiter(values, delim=', ', last_delim=' or ')[source]
Format the list as a human readable string.
Will format the list as a human readable enumeration, separated by commas (changable with delim) with last value separated with “or” (changable with last_delim).
- Parameters:
values (collections.abc.Iterable) – list of items to concatenate
delim (str) – primary delimiter for objects, comma by default
last_delim (str) – delimiter for last object in list
- Return type: