summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_set.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-04-21 15:47:16 (GMT)
committerGeorg Brandl <georg@python.org>2007-04-21 15:47:16 (GMT)
commita18af4e7a2091d11478754eb66ae387a85535763 (patch)
treefea8015d656cfee937bb6f3d106e6ca0e9f19d78 /Lib/test/test_set.py
parent4d2adcca52ced412d4bdf131b872729c43520d58 (diff)
downloadcpython-a18af4e7a2091d11478754eb66ae387a85535763.zip
cpython-a18af4e7a2091d11478754eb66ae387a85535763.tar.gz
cpython-a18af4e7a2091d11478754eb66ae387a85535763.tar.bz2
PEP 3114: rename .next() to .__next__() and add next() builtin.
Diffstat (limited to 'Lib/test/test_set.py')
-rw-r--r--Lib/test/test_set.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 8a43109..997e17f 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -1382,7 +1382,7 @@ class I:
self.i = 0
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
if self.i >= len(self.seqn): raise StopIteration
v = self.seqn[self.i]
self.i += 1
@@ -1402,14 +1402,14 @@ class X:
def __init__(self, seqn):
self.seqn = seqn
self.i = 0
- def next(self):
+ def __next__(self):
if self.i >= len(self.seqn): raise StopIteration
v = self.seqn[self.i]
self.i += 1
return v
class N:
- 'Iterator missing next()'
+ 'Iterator missing __next__()'
def __init__(self, seqn):
self.seqn = seqn
self.i = 0
@@ -1423,7 +1423,7 @@ class E:
self.i = 0
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
3 // 0
class S:
@@ -1432,7 +1432,7 @@ class S:
pass
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
raise StopIteration
from itertools import chain, imap