Way for see if dict has a key

Fredrik Lundh fredrik at pythonware.com
Fri Jun 30 11:03:34 EDT 2006


Bruno Desthuilliers wrote:

>> on my machine, "key in dict" is about twice as fast as the full
 >> try/getitem construct when the key is present in the dict,
> 
> Doesn't it depends on the number of keys in the dict ?

why would it depend on the number of keys in the dict ?

</F>




More information about the Python-list mailing list