Walk through dictionary keys?

Carsten Gaebler cg at schlund.de
Tue Dec 19 17:23:37 CET 2000


Hi!

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

because this makes a copy of all the keys. I'm looking for something
like Perl's "each".

Regards
Carsten.



More information about the Python-list mailing list