This is not a error/fault I am just saying this to share what I just read now on internet :). They say it is always better to use 'in' rather than 'has_key' to check if a dictionary has the given key. I found this small one-liner from stackoverflow webiste.

$ python -mtimeit -s'd=dict.fromkeys(range(99))' '12 in d'
10000000 loops, best of 3: 0.0983 usec per loop
$ python -mtimeit -s'd=dict.fromkeys(range(99))' 'd.has_key(12)'
1000000 loops, best of 3: 0.21 usec per loop

Two reason they generally say to use 'in' is cause it is faster and also python > 3.0 doesn't have 'has_key'.