kennethreitz / records

SQL for Humans™
https://pypi.python.org/pypi/records/
ISC License
7.14k stars 570 forks source link

removed a manual indexer iterator pitfall #215

Closed NaelsonDouglas closed 5 months ago

NaelsonDouglas commented 2 years ago

The problem The code was iterating on the list 'outputs' manually using for i, element in enumerate(outputs

for i in range(len(row))

and accessing the data manually as:

row[i]

but Python has a built-in manner to deal with it using the method enumerate

for index, element in enumerate(row):

and thus making the access to the data easier

The solution Changed the manual indexer to the enumerated iterator.

kennethreitz commented 5 months ago

thanks!