Fast comparison between two Python dictionary
<p>Say i have two Python dictionaries - dictA and dictB. I need to find out if there are any keys which are present in dictB but not in dictA.  Which is the fastest way to go about it.
Should i convert the dictionary keys into a set and then go about..</p>

<p>Interested in knowing your thoughts... </p>

<hr>

<p>Thanks for your responses.</p>

<p>Apologies for not stating my question properly.
My scenario is like this - i have a dictA which can be the same as dictB or may have some keys missing as compared to dictB or else the value of some keys might be different which has to be set to that of dictA key's value.</p>

<p>Problem is the dictionary has no standard and can have keys which can be dict of dict....</p>

<p>Say</p>

<pre><code>dictA={'key1':a, 'key2':b, 'key3':{'key11':cc, 'key12':dd}, 'key4':{'key111':{....}}}
dictB={'key1':a, 'key2:':newb, 'key3':{'key11':cc, 'key12':newdd, 'key13':ee}.......
</code></pre>

<p>So 'key2' value has to be reset to the new value and 'key13' has to be added inside the dict.
The key value does not have a fixed format. It can be a simple value or a dict or a dict of dict....</p>
