On Sat, Apr 11, 2020 at 4:21 AM Rhodri James <[email protected]> wrote:
> Since the introduction of enumerate() lo! these many moons ago, I find I > almost never write range(len(x)) as a loop iterable. > Out of curiosity, I just grepped about 300k lines of source: 234 - enumerate() in for loops 140 - zip() in for loops 12 - range(len()) in for loops About half of those 12 range uses are interfacing to extension modules that only provide an indexing interface to array-like data, so really no way around it... The remainder are in unit tests where we are just sloppily generating N-long test data values, where it could be better formulated, but no one cares enough to change it.
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/VBV7ADOYQ6K5TNPVAXEWGXNKITLMIHQU/ Code of Conduct: http://python.org/psf/codeofconduct/
