I have a list of objects and I want to only return objects that have a field that contains a certain value.
Is there a more terse/pythonic way of doing this:
list-o-dicts = get-my-objects()
for dict in list-o-dicts:
if 'mystring' in dict['myfield']:
pprint( dict )
Does python have a cool, sugary, shortcut for doing this?