Neil Cerutti wrote: > On 2006-11-29, Roberto Bonvallet <[EMAIL PROTECTED]> 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 -- http://mail.python.org/mailman/listinfo/python-list