Python 3 compatibility improved#6
Open
peterwittek wants to merge 4 commits intogmum:masterfrom
peterwittek:master
Open
Python 3 compatibility improved#6peterwittek wants to merge 4 commits intogmum:masterfrom peterwittek:master
peterwittek wants to merge 4 commits intogmum:masterfrom
peterwittek:master
Conversation
kudkudak
reviewed
Jan 20, 2017
| for i in xrange(N): | ||
| for j in xrange(N): | ||
| for k in xrange(N): | ||
| for i in range(N): |
Member
There was a problem hiding this comment.
This will slow down code for Python2. I would use range from six module (http://pythonhosted.org/six/) which defaults to xrange for Python2
Author
There was a problem hiding this comment.
Since we are talking about one single file where the xrange functions were replaced, we could simply do this:
try:
range = xrange
except:
pass
kudkudak
reviewed
Jan 20, 2017
pykernels/graph/randomwalk.py
Outdated
| @@ -8,7 +8,7 @@ | |||
| from pykernels.base import Kernel, GraphKernel | |||
Member
There was a problem hiding this comment.
If we decide to use relative imports, I would keep it consistent, i.e. also change pykernels.base import to .base
Author
There was a problem hiding this comment.
Fair enough, I don't have strong feelings either way, it is just the previous import scheme was broken in Python 3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.