Add function to search for substr in list

This commit is contained in:
Mike Place 2016-10-19 15:55:02 +09:00
parent 007eef84d7
commit 7f141ba38c
No known key found for this signature in database
GPG key ID: 9136F4F13705CFD3

View file

@ -3010,3 +3010,10 @@ def str_version_to_evr(verstring):
release = ''
return epoch, version, release
def substr_in_list(string_to_search_for, list_to_search):
'''
Return a boolean value that indicates whether or not a given
string is present in any of the strings which comprise a list
'''
return any(string_to_search_for in s for s in list_to_search)