Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#23812 closed Cleanup/optimization (fixed)

Use django.utils.six.moves.range instead of xrange

Reported by: Tim Graham Owned by: mhall1
Component: Core (Other) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

These imports are equivalent but by using range the code looks more like Python 3 and has the advantage that we simply remove the import when the time comes to drop Python 2.

Change History (9)

comment:1 by Collin Anderson, 10 years ago

Has patch: set

comment:2 by Collin Anderson, 10 years ago

Has patch: unset

comment:3 by mhall1, 10 years ago

Owner: changed from nobody to mhall1
Status: newassigned

comment:4 by mhall1, 10 years ago

The changes are available at https://github.com/mhall1/django/tree/ticket_23812

Tests passed under SQLite. Note: 7 tests are failing, but they are marked as expected failures and are also failing on master.

Last edited 10 years ago by mhall1 (previous) (diff)

comment:5 by mhall1, 10 years ago

Has patch: set

comment:6 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 895dc880ebef46c9577c6908daf283248685f73c:

Fixed #23812 -- Changed django.utils.six.moves.xrange imports to range

comment:7 by Tim Graham <timograham@…>, 10 years ago

In bc88ec550afd5ce972b8c902572c6447d89c0cc9:

Updated advice on six.moves.range/xrange; refs #23812.

comment:8 by Tim Graham <timograham@…>, 10 years ago

In e905d4984dbaca7e9175205d64ef8794fa7ded12:

[1.7.x] Updated advice on six.moves.range/xrange; refs #23812.

Backport of bc88ec550afd5ce972b8c902572c6447d89c0cc9 from master

comment:9 by Tim Graham <timograham@…>, 10 years ago

In 89f9bf61bbbf8f5d2593c53ae3fbe45d8f110311:

[1.6.x] Updated advice on six.moves.range/xrange; refs #23812.

Backport of bc88ec550afd5ce972b8c902572c6447d89c0cc9 from master

Note: See TracTickets for help on using tickets.
Back to Top