Skip to content

Commit 01c4b64

Browse files
committed
etc: Comment why we're binding xrange
Just mention there are differences between python versions
1 parent ab216a9 commit 01c4b64

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/etc/gdb_rust_pretty_printing.py

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import sys
1414
import debugger_pretty_printers_common as rustpp
1515

16+
# We want a version of `range` which doesn't allocate an intermediate list,
17+
# specifically it should use a lazy iterator. In Python 2 this was `xrange`, but
18+
# if we're running with Python 3 then we need to use `range` instead.
1619
if sys.version_info.major >= 3:
1720
xrange = range
1821

0 commit comments

Comments
 (0)