Skip to content

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jan 20, 2018

@nealwu As requested at #3103 (comment)

For all files that use the Python 2-only builtin function xrange(), add the line from six.moves import xrange for compatibility with Python 3.

@tensorflow-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@panyx0718
Copy link
Contributor

panyx0718 commented Jan 20, 2018

The xrange is imported but not used? Would this cause lint issue?

@cclauss
Copy link
Contributor Author

cclauss commented Jan 20, 2018

In which file is xrange() not used?

@panyx0718
Copy link
Contributor

I was looking at the diff. They import xrange. But I don't see xrange is used in the diff. I assume they weren't used before, otherwise there would be exceptions before this change.

@cclauss
Copy link
Contributor Author

cclauss commented Jan 20, 2018

Each file contains at least one call to xrange(). You can test this via:

python3 -m flake8 . --select=F821 | grep xrange

@panyx0718
Copy link
Contributor

Oh, I see. you changed the existing xrange to use the six xrange

@nealwu
Copy link
Contributor

nealwu commented Jan 22, 2018

Looks good @cclauss. Thanks!

@nealwu nealwu merged commit d90d528 into tensorflow:master Jan 22, 2018
@cclauss cclauss deleted the from-six.moves-import-xrange branch January 22, 2018 21:49
Adrrei pushed a commit to Adrrei/models that referenced this pull request Dec 16, 2018
…-xrange

from six.moves import xrange (en masse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants