find value in several dictionaries
<p>first you have only one dictionary,everything's fine with</p>

<pre><code>def getNPCName(self,ID):
    return self.npcs[ID].name
</code></pre>

<p>then,got another dictionary,the code become this</p>

<pre><code>def getNPCName(self,ID):
    for x in (self.npcs,self.deadnpcs):
        if ID in x:
            return x[ID].name 
    return ''
</code></pre>

<p>i don't think this would be a good practice.</p>

<p>there should be some dictionary already exists, they union several dictionaries,not really merge them, but act just like one dictionary for some apis.</p>

<pre><code>self.allnpclist = some_kind_of_dictionary(self.alive,self.dead)
</code></pre>

<p>my code should be this</p>

<pre><code>def getNPCName(self,ID):
    return self.allnpclist[ID].name
</code></pre>

<p>i think i shouldn't write it by myself</p>
