diff options
| author | Tim Graham <timograham@gmail.com> | 2014-12-13 13:41:31 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-12-13 13:42:51 -0500 |
| commit | 89f9bf61bbbf8f5d2593c53ae3fbe45d8f110311 (patch) | |
| tree | dcba9a8ee7f8f6a1211edffb5cdfb584ddf4c2df /docs/topics/python3.txt | |
| parent | ec861bca692dde67579967c5ebeb0f6b5995aad7 (diff) | |
[1.6.x] Updated advice on six.moves.range/xrange; refs #23812.
Backport of bc88ec550afd5ce972b8c902572c6447d89c0cc9 from master
Diffstat (limited to 'docs/topics/python3.txt')
| -rw-r--r-- | docs/topics/python3.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/topics/python3.txt b/docs/topics/python3.txt index 0c78daa7b4..97e9f5e76b 100644 --- a/docs/topics/python3.txt +++ b/docs/topics/python3.txt @@ -359,7 +359,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 ~~~~~~~~~~~~~ |
