DEV Community

Discussion on: Fully automated metadata objects with Python 3.7's brand new dataclass library.

Collapse
 
ipv6_python profile image
Gregory Wendel

Hello - thanks for the helpful article and code examples. Pylint suggested I use enumerate instead of for ... . Here is the code I changed to follow the advice. I think I am getting the same response, but am curious if you see any issues with it.

Original:
for i in range(0, len(author_names)):
self.authors.append({"id": author_ids[i], "name": author_names[i]})

My changes:
for count in enumerate(author_names):
self.authors.append({"id": author_ids[count], "name":author_names[count]})

Collapse
 
furkan_kalkan1 profile image
Furkan Kalkan

enumerate() is ok.