I need to be able to find an item in a list (an item in this case being a dict) based on some value inside that dict. The structure o
Just in case, if you want lookup search on the basis of the key of a dictionary.
my_item = next((item for item in my_list if item.has_key(my_unique_key)), None)
For 3.0+, has_key() has been deprecated. Instead use in:
my_item = next((item for item in mylist if 'my_unique_key' in item), None)
https://docs.python.org/3.0/whatsnew/3.0.html#builtins