title: How to check if dictionary is within a list of dictionaries on both key and value of dict, where dicts can be nested?
body: <p>I want to check if an entire dictionary (both the key and value) exists in a list of dictionaries. Each dictionary can be a nested dictionary of dictionaries and lists.</p>
  
  <p>When I have many scalars that I want to check if each scalar exists within a target list of scalars, I usually make the target list into a set and check existence in the set, like <code>scalar in set(list_of_scalars)</code>. (Please let me know if this is already not the best way to have been doing this) </p>
  
  <p>For dicts, I can't do <code>my_dict in set(list_of_dicts)</code> because that raises <code>unhashable type: 'dict'</code>. </p>
  
  <p>Doing <code>my_dict in list_of_dicts</code> seems to correctly returns <code>False</code> if the same key name exists but value is different (which is what I want), but I'm concerned about the runtime; does python optimize this internally? What else can I be doing?</p>
  
  <p>EDIT: Assume I will be performing MANY lookups, and using Python3.7</p>