Walk through dictionary keys?

Neil Schemenauer nas at arctrix.com
Tue Dec 19 05:36:28 EST 2000


On Tue, Dec 19, 2000 at 05:23:37PM +0100, Carsten Gaebler wrote:
> Is there a way of 'walking' through the keys of a dictionary? If I have
> a large dictionary I'd like to prevent 
> 
> for key in d.keys():
>     do_something

Python 2.1 will have a d.popitem() method for just this purpose.

  Neil




More information about the Python-list mailing list