how to explain such codes, python's bug or mine?
MaHahaXixi
enjoy_linux at hotmail.com
Thu Apr 14 01:56:44 EDT 2005
SORRY, my inattention
"Fredrik Lundh" <fredrik at pythonware.com> wrote in message
news:mailman.1832.1113394505.1799.python-list at python.org...
> "MaHahaXixi" <enjoy_linux at hotmail.com> wrote:
>
> > for python, i am a newbie, but i did not found the warning of such usage
> > from the python tutorial
>
> "4.2 for Statements"
>
> "It is not safe to modify the sequence being iterated over in the loop
(this
> can only happen for mutable sequence types, such as lists). If you
need
> to modify the list you are iterating over (for example, to duplicate
selected
> items) you must iterate over a copy." (followed by an example)
>
> </F>
>
>
>
More information about the Python-list
mailing list