Neil Cerutti wrote: > On 2006-11-29, Roberto Bonvallet <Roberto.Bonvallet at cern.ch> wrote: >> BTW, iterating over range(len(a)) is an anti-pattern in Python. > > Unless you're modifying elements of a, surely? enumerate is your friend :) for n, item in enumerate(a): if f(item): a[n] = whatever -- Roberto Bonvallet