Using lists and dictionaries to store temporary information
<p>I will have alot of similar objects with similar parameters. Example of an object parameters would be something like :</p>

<p>name, boolean, number and list. </p>

<p>The name must be unique value among all the objects while values for boolean, number and list parameters must not. </p>

<p>I could store the data as list of dictionaries i guess. Like that:</p>

<pre><code>list = [
  {'name':'a', 'bool':true, 'number':123, 'list':[1, 2, 3]},
  {'name':'b', 'bool':false, 'number':143, 'list':[1, 3, 5]},
  {'name':'c', 'bool':false, 'number':123, 'list':[1, 4, 5, 18]},
]
</code></pre>

<p>What would be the fastest way to check if the unique name exists in the list of dictionaries, before i create another dictionary in that list? Do i have to loop through the list and check what is the value of list[i][name]? What would be fastest and least memory conserving to hold and process that information, assuming, that different similar lists might be simultanously processed in different threads/tasks and that their size could be anywhere between 100 to 100 000 dictionaries per list. Should i store those lists in database instead of memory?</p>

<p>I understand that perhaps i should not be thinking about optimizing (storing the info and threads) before the project is working, so please, answer the unique name lookup question first :)</p>

<p>Thanks, 
Alan</p>
