mirror of
https://github.com/django/django.git
synced 2025-08-18 01:30:42 +00:00
[1.7.x] Updated advice on six.moves.range/xrange; refs #23812.
Backport of bc88ec550a
from master
This commit is contained in:
parent
0a8b911582
commit
e905d4984d
1 changed files with 4 additions and 1 deletions
|
@ -358,7 +358,10 @@ The ``long`` type no longer exists in Python 3. ``1L`` is a syntax error. Use
|
|||
``xrange``
|
||||
~~~~~~~~~~
|
||||
|
||||
Import ``six.moves.xrange`` wherever you use ``xrange``.
|
||||
If you use ``xrange`` on Python 2, import ``six.moves.range`` and use that
|
||||
instead. You can also import ``six.moves.xrange`` (it's equivalent to
|
||||
``six.moves.range``) but the first technique allows you to simply drop the
|
||||
import when dropping support for Python 2.
|
||||
|
||||
Moved modules
|
||||
~~~~~~~~~~~~~
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue