[pypy-commit] pypy py3k: we can no longer index the keys() of a dict, use next(iter(...)) instead

antocuni noreply at buildbot.pypy.org
Fri Jan 27 20:29:29 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r51883:3014f5e44e49
Date: 2012-01-27 16:56 +0100
http://bitbucket.org/pypy/pypy/changeset/3014f5e44e49/

Log:	we can no longer index the keys() of a dict, use next(iter(...))
	instead

diff --git a/pypy/interpreter/test/test_compiler.py b/pypy/interpreter/test/test_compiler.py
--- a/pypy/interpreter/test/test_compiler.py
+++ b/pypy/interpreter/test/test_compiler.py
@@ -443,7 +443,7 @@
         snippet = str(py.code.Source(r'''
             d = {}
             d[...] = 12
-            assert d.keys()[0] is Ellipsis
+            assert next(iter(d.keys())) is Ellipsis
         '''))
         code = self.compiler.compile(snippet, '<tmp>', 'exec', 0)
         space = self.space


More information about the pypy-commit mailing list