What's the difference ?

Alex alexandre.badez at gmail.com
Wed Aug 29 09:39:27 EDT 2007


Hye,

I was just wondering what is the difference between

>> if my_key in mydict:
>>     ...

and

>> if mydict.has_keys(my_key):
>>     ...

I've search a bit in the python documentation, and the only things I
found was that they are "equivalent".

But in this (quiet old) sample ( "http://aspn.activestate.com/ASPN/
Cookbook/Python/Recipe/59875" ), there is difference between the two
notation.

Thanks in advance




More information about the Python-list mailing list