I have written this helper function. I want to know if there is an even better approach, considering that I do not want to add a dependency to any additional module.
def _isobjectInList(lst, name, criteria='startswith'): """ Find item in the list starting or ending with name passed. :param lst: list of items/ objects :type lst: list :param name: name starting or ending with. :param name: string :param criteria: function of string obect whether startswith or endswith :param criteria: built-in method of str object """ return [itemfound for itemfound in lst if getattr(itemfound, criteria)(name)]