From bc88ec550afd5ce972b8c902572c6447d89c0cc9 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 13 Dec 2014 13:41:31 -0500 Subject: [PATCH] Updated advice on six.moves.range/xrange; refs #23812. --- docs/topics/python3.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/topics/python3.txt b/docs/topics/python3.txt index d8a2f646bd3..8e4c3f1e63b 100644 --- a/docs/topics/python3.txt +++ b/docs/topics/python3.txt @@ -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 ~~~~~~~~~~~~~