Apply 2to3 next fix.#2134
Conversation
|
Test results for commit 360c5cd merged into master
Not available for testing: python2.6 |
There was a problem hiding this comment.
Alternatively we could treat this as:
def __next(self)__:
# ...
if not py3compat.PY3:
next = __next__
This would make it more obvious what needs to be ripped out if Python 2 support was ever dropped...
There was a problem hiding this comment.
I think I'd side with doing that.
There was a problem hiding this comment.
I agree. I've made the changes and pushed a new commit.
Manually set `next = __next__` for Python 2 support.
|
Test results for commit 30e4a14 merged into master
Not available for testing: python2.6 |
|
This looks OK to me. If no-one objects in about a day, we can merge it. |
There was a problem hiding this comment.
Is there a good reason that this method is defined in a conditional, and not just next = __next__? I know the method is not required in py3, but it seems cleaner to just define it.
|
Ah, now I just saw the conversation above. I don't really agree with the decision, but I don't feel strongly, so I'll go with you guys. Also, Python 2.6 testing is the most important here before merge. |
|
Test results for commit 30e4a14 merged into master
Not available for testing: python3.1 |
|
2.6 is happy, +1 to merge. |
|
Merged - thanks. |
Apply 2to3 `next` fix.
Continuing on the Python 2/3 compatibility (which I'll refer to as '2and3') from #2095 and #2100, I propose to include the changes from running
2to3 -f next:One small issue is the behavior of
next(x)on user defined classes:Consider
test_next.pyAnd run it in Python 2.7 and 3.2:
To work around this difference, I've just set
next = __next__manually after applying the 2to3 fix. This also maintains compatibility with any third party code which callsx.next().