etc: Comment why we're binding xrange

Just mention there are differences between python versions
This commit is contained in:
Alex Crichton 2016-07-06 11:17:26 -07:00
parent ab216a96aa
commit 01c4b64b1c

View File

@ -13,6 +13,9 @@ import re
import sys
import debugger_pretty_printers_common as rustpp
# We want a version of `range` which doesn't allocate an intermediate list,
# specifically it should use a lazy iterator. In Python 2 this was `xrange`, but
# if we're running with Python 3 then we need to use `range` instead.
if sys.version_info.major >= 3:
xrange = range