diff options
author | Georg Brandl <georg@python.org> | 2007-04-21 15:47:16 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-04-21 15:47:16 (GMT) |
commit | a18af4e7a2091d11478754eb66ae387a85535763 (patch) | |
tree | fea8015d656cfee937bb6f3d106e6ca0e9f19d78 /Misc | |
parent | 4d2adcca52ced412d4bdf131b872729c43520d58 (diff) | |
download | cpython-a18af4e7a2091d11478754eb66ae387a85535763.zip cpython-a18af4e7a2091d11478754eb66ae387a85535763.tar.gz cpython-a18af4e7a2091d11478754eb66ae387a85535763.tar.bz2 |
PEP 3114: rename .next() to .__next__() and add next() builtin.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/Vim/vim_syntax.py | 4 | ||||
-rw-r--r-- | Misc/cheatsheet | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Misc/Vim/vim_syntax.py b/Misc/Vim/vim_syntax.py index 55dd277..c43d226 100644 --- a/Misc/Vim/vim_syntax.py +++ b/Misc/Vim/vim_syntax.py @@ -139,7 +139,7 @@ def fill_stmt(iterable, fill_len): overflow = None while total_len < fill_len: try: - new_item = it.next() + new_item = next(it) buffer_.append(new_item) total_len += len(new_item) + 1 except StopIteration: @@ -188,7 +188,7 @@ def main(file_path): FILL - len(prefix) - len(indent)) try: while True: - print>>FILE, indent + prefix + stmt_iter.next() + print>>FILE, indent + prefix + next(stmt_iter) except StopIteration: print>>FILE, '' else: diff --git a/Misc/cheatsheet b/Misc/cheatsheet index 0b4b941..0e34b15 100644 --- a/Misc/cheatsheet +++ b/Misc/cheatsheet @@ -721,7 +721,7 @@ File Exceptions return [result] -- Exits from function (or method) and returns result (use a tuple to return more than one value). If no result given, then returns None. yield result -- Freezes the execution frame of a generator and returns the result - to the iterator's .next() method. Upon the next call to next(), + to the iterator's .__next__() method. Upon the next call to __next__(), resumes execution at the frozen point with all of the local variables still intact. @@ -1058,7 +1058,7 @@ Exception> SystemExit On 'sys.exit()' StopIteration - Signal the end from iterator.next() + Signal the end from iterator.__next__() StandardError Base class for all built-in exceptions; derived from Exception root class. |