Steven D'Aprano <[EMAIL PROTECTED]> writes:

> and help(reversed) but neither gives any insight to what happens
> when you use reversed() on a sequence, then modify the sequence.

I would think the answer is the same for any question about modifying
sequences while iterating: "undefined, therefore don't do that".

In other words, if you think you'll be modifying the sequence during
iteration (even if you're iterating indirectly via something like
reversed()), iterate over a copy instead.

-- 
 \           "Professionalism has no place in art, and hacking is art. |
  `\      Software Engineering might be science; but that's not what I |
_o__)        do. I'm a hacker, not an engineer."  -- Jamie W. Zawinski |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to