En Sat, 03 Mar 2007 19:55:16 -0300, Steven D'Aprano  
<[EMAIL PROTECTED]> escribió:

> I personally don't see that pop has any advantage, especially since the
> most useful example
>
> while some_dict:
>     do_something_with(some_dict.pop())
>
> doesn't work. Instead you have to write this:

For such constructs, one can use popitem:

while some_dict:
     do_something_with(some_dict.popitem()[1])

The popitem method is older than pop. I don't like pop either.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to