Author: Konstantin Lopuhin <kostia.lopu...@gmail.com> Branch: py3k-list-compr-or Changeset: r66101:bb9bab43e9dc Date: 2013-08-06 23:21 +0200 http://bitbucket.org/pypy/pypy/changeset/bb9bab43e9dc/
Log: two failing tests for list comprehensions with or diff --git a/pypy/interpreter/astcompiler/test/test_astbuilder.py b/pypy/interpreter/astcompiler/test/test_astbuilder.py --- a/pypy/interpreter/astcompiler/test/test_astbuilder.py +++ b/pypy/interpreter/astcompiler/test/test_astbuilder.py @@ -1236,6 +1236,12 @@ if1, if2 = comps[0].ifs assert isinstance(if1, ast.Name) assert isinstance(if2, ast.Name) + gen = self.get_first_expr(brack("x for x in y or z")) + comp = gen.generators[0] + assert isinstance(comp.iter, ast.BoolOp) + assert len(comp.iter.values, 2) + assert isinstance(comp.iter.values[0], ast.Name) + assert isinstance(comp.iter.values[1], ast.Name) def test_genexp(self): self.check_comprehension("(%s)", ast.GeneratorExp) diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py b/pypy/interpreter/astcompiler/test/test_compiler.py --- a/pypy/interpreter/astcompiler/test/test_compiler.py +++ b/pypy/interpreter/astcompiler/test/test_compiler.py @@ -891,6 +891,10 @@ py.test.raises(SyntaxError, self.simple_test, "for *a in x: pass", None, None) + def test_list_compr_or(self): + yield self.st, 'x = list(d for d in [1] or [])', 'x', [1] + yield self.st, 'y = [d for d in [1] or []]', 'y', [1] + class AppTestCompiler: _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit