Python: remove dictionary from list,thelist[:] = [d for d in thelist if d.get('id') != 2]