softmatterlab / DeepTrack

MIT License
37 stars 13 forks source link

Improve code readability with enumerate() #4

Open aleide opened 5 years ago

aleide commented 5 years ago

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):

hsaga commented 5 years ago

Can we close this issue?