]> git.lizzy.rs Git - rust.git/commitdiff
etc: Comment why we're binding xrange
authorAlex Crichton <alex@alexcrichton.com>
Wed, 6 Jul 2016 18:17:26 +0000 (11:17 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 6 Jul 2016 18:17:26 +0000 (11:17 -0700)
Just mention there are differences between python versions

src/etc/gdb_rust_pretty_printing.py

index ad0c9d085aabb4e0bf52614976e582c6e3de9b32..554ab66bc563d85328bd8c8303bcf035ac8fb380 100755 (executable)
@@ -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