[Python-3000] Iterating over a dict

Benji York benji at benjiyork.com
Sat Apr 1 16:46:09 CEST 2006


Thomas Lotze wrote:
> Hi,
> 
> I wonder what's the reason for iterating over a dict by keys:

I suspect that at least part of the reason is that given a key you can 
easily get the corresponding value, but given the value it's difficult 
to get the key.  Seems like a good choice for "bare" dict iteration.
--
Benji York


More information about the Python-3000 mailing list