[EMAIL PROTECTED] wrote:
> I wish to pop/del some items out of dictionary while iterating over
> it.

Iterate over a copy.

    a_orig = { 'a': 1, 'b': 2 }
    a = dict(a_orig)
    for k, v in a_orig.iteritems():
        if v == 2:
            del a[k]

-- 
 \      "I know the guy who writes all those bumper stickers. He hates |
  `\                                      New York."  -- Steven Wright |
_o__)                                                                  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to