On Jan 15, 6:18 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> Helmut Jarausch <[EMAIL PROTECTED]> writes:
> > def del_by_key(L,key) :
> >    for pos, (k,d) in enumerate(L):
> >      if  k == key :
> >        del L[pos]
> >        break
>
> This looks very dangerous, mutating L while iterating over it.

This would indeed be dangerous *without* the break statement !-)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to