This is an archive of the discontinued LLVM Phabricator instance.

Fix uses of range / xrange for Python 3
ClosedPublic

Authored by zturner on Oct 23 2015, 11:21 AM.

Details

Reviewers
tfiala
Summary

Hi Todd,

I've been putting most of this stuff in withouty review, but I figure every once in a while I should pass one your way as a sanity check to make sure I'm still on the right path.

Anyway, for this one. xrange() is removed from Python 3, and range() is no longer a function but a "sequence object" which must be converted to a list. In theory I could have used six.moves.xrange, but I decided that the efficiency provided by xrange wasn't important in the code, so I changed it all to use range instead.

Diff Detail

Event Timeline

zturner updated this revision to Diff 38244.Oct 23 2015, 11:21 AM
zturner retitled this revision from to Fix uses of range / xrange for Python 3.
zturner updated this object.
zturner added a reviewer: tfiala.
zturner added a subscriber: lldb-commits.
zturner added inline comments.Oct 23 2015, 11:23 AM
test/lang/go/types/TestGoASTContext.py
134

Looks like I missed this one. I'll put this one back to list(range(5)) before comitting.

tfiala accepted this revision.Oct 24 2015, 8:01 AM
tfiala edited edge metadata.

I've been putting most of this stuff in withouty review, but I figure every once in a while I should pass one your way as a sanity check to make sure I'm still on the right path.

That's fine. As long as it isn't breaking anything, which so far it seems like hasn't :-)

xrange() is removed from Python 3, and range() is no longer a function but a "sequence object" which must be converted to a list. In theory I could have used six.moves.xrange, but I decided that the efficiency provided by xrange wasn't important in the code, so I changed it all to use range instead.

Looks good!

This revision is now accepted and ready to land.Oct 24 2015, 8:01 AM
tfiala added inline comments.Oct 24 2015, 8:01 AM
test/lang/go/types/TestGoASTContext.py
134

Okay.

zturner closed this revision.Oct 26 2015, 1:22 PM