Say I have a list of dicts where dict['id']
is unique, and I want to access one specific dict.
This is how I would usually do that, more or less.
d_ = [d for d in list_of_dicts where d['id']=='the_id_i_want'][0]
Is there a better/cleaner/more pythonic way to do this?
This is an API response, otherwise I'd just make it a dict in the first place.