Skip to content

Commit fc5b8cc

Browse files
committed
2to3: Apply next fixer.
The next builtin has been available since Python 2.6 and allows `it.next()` to be replaced by `next(it)`. In Python 3 the `next` method is gone entirely, replaced entirely by the `__next__` method. The next fixer changes all the `it.next()` calls to the new form and renames the `next` methods to `__next__`. In order to keep Numpy code backwards compatible with Python 2, a `next` method was readded to all the Numpy iterators after the fixer was run so they all contain both methods. The presence of the appropriate method could have been made version dependent, but that looked unduly complicated. Closes #3072.
1 parent d0f3f77 commit fc5b8cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpydoc/comment_eater.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def new_noncomment(self, start_lineno, end_lineno):
106106

107107
def new_comment(self, string, start, end, line):
108108
""" Possibly add a new comment.
109-
109+
110110
Only adds a new comment if this comment is the only thing on the line.
111111
Otherwise, it extends the noncomment block.
112112
"""

0 commit comments

Comments
 (0)