Bug #9297

Py3: Remove unnecessary conversions to list

Added by Joseph Pizzi about 1 month ago.

Status:New Start date:08/21/2021
Priority:Normal Due date:
Assignee:Joseph Pizzi % Done:


Target version:- Estimated time:0.50 hour
Chirp Version:daily Platform:Windows
Model affected:(All models)


Dispite 2to3's xrange converter, not all instances of range need to be wrapped in conversion to list.

For example,
for i in reverse(range(0, len(bcd_array))):
is just fine without the range being placed in a list.
2to3 replaces the above line with,
for i in reversed(list(range(0,l len(bcd_array)))):

Associated revisions

Revision 3556:dce6092cf365
Added by Joseph Pizzi about 1 month ago

This patch will keep bitwise from unnecessarily converting ranges to lists
when it is not needed.

related to #9297

Also available in: Atom PDF