[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problems found while inspecting 2005->2007 debdiffs



On Sat, Feb 24, 2007 at 12:38:34PM +0100, Frank Küster wrote:
> > I fixed that by making a safe copy of the needed parts of <some list>
> > before entering the loop.
> 
> To me, that sounds like a very peculiar feature (or rather bug) in
> Python, since it is contrary to to what one expects.  Oh well, or not,
> since I don't see an easy way to remove a particular entry from a
> list/array in shell or perl.

Modifying the thing you're iterating over is likely to lead to errors
in any language.  In shell, no easy way to remove items from lists.
In Perl, use the splice function: @a = splice(@a, 3, 1) for example.

   Julian



Reply to: