summaryrefslogtreecommitdiff
path: root/Lib/test/test_grammar.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-04-21 15:47:16 +0000
committerGeorg Brandl <georg@python.org>2007-04-21 15:47:16 +0000
commita18af4e7a2091d11478754eb66ae387a85535763 (patch)
treefea8015d656cfee937bb6f3d106e6ca0e9f19d78 /Lib/test/test_grammar.py
parent4d2adcca52ced412d4bdf131b872729c43520d58 (diff)
downloadcpython-git-a18af4e7a2091d11478754eb66ae387a85535763.tar.gz
PEP 3114: rename .next() to .__next__() and add next() builtin.
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r--Lib/test/test_grammar.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 2c1b6ca941..bd04735dab 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -785,9 +785,9 @@ class GrammarTests(unittest.TestCase):
def testGenexps(self):
# generator expression tests
g = ([x for x in range(10)] for x in range(1))
- self.assertEqual(g.next(), [x for x in range(10)])
+ self.assertEqual(next(g), [x for x in range(10)])
try:
- g.next()
+ next(g)
self.fail('should produce StopIteration exception')
except StopIteration:
pass
@@ -795,7 +795,7 @@ class GrammarTests(unittest.TestCase):
a = 1
try:
g = (a for d in a)
- g.next()
+ next(g)
self.fail('should produce TypeError')
except TypeError:
pass