Re: how to explain such codes, python's bug or mine?
- From: "Fredrik Lundh" <fredrik@xxxxxxxxxxxxxx>
- Date: Wed, 13 Apr 2005 14:11:12 +0200
"MaHahaXixi" <enjoy_linux@xxxxxxxxxxx> 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>
.
- References:
- Re: how to explain such codes, python's bug or mine?
- From: ajikoe@xxxxxxxxx
- Re: how to explain such codes, python's bug or mine?
- Prev by Date: terminate exectutioin in PythonWin
- Next by Date: Re: [perl-python] Python documentation moronicities (continued)
- Previous by thread: Re: how to explain such codes, python's bug or mine?
- Next by thread: Re: how to explain such codes, python's bug or mine?
- Index(es):
Relevant Pages
|