softmatterlab / DeepTrack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve code readability with enumerate()

aleide opened this issue · comments

The enumerate(iterator, start index) function gives you an iterator that returns both an index, starting at 'start index', and the regular output from 'iterator'. If 'iterator' has multiple return values they will be packaged as a tuple when using enumerate.

Example:
for index, item in zip(range(len(iter_object)), iter_object):
could be re-written as
for index, item in enumerate(iter_object):

Can we close this issue?