New issue 2884: [3.6] PythonCodeGenerator fails on annotated list 
comprehensions assignments
https://bitbucket.org/pypy/pypy/issues/2884/36-pythoncodegenerator-fails-on-annotated

Gary Wang:

CPython 3.6:

```
$ python3.6 -c 'a: list = [i for i in range(10)]; print(a)'
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
```

PyPy 3.6 nightly:

```
$ ./pypy3 -c 'a: list = [i for i in range(10)]'
RPython traceback:
  File "pypy_interpreter.c", line 33880, in BuiltinCode_funcrun_obj
  File "pypy_module___builtin__.c", line 24006, in exec_
  File "pypy_interpreter_2.c", line 35793, in PyFrame_exec_
  File "pypy_interpreter.c", line 53550, in PythonAstCompiler__compile_ast
  File "pypy_interpreter_astcompiler.c", line 1544, in compile_ast
  File "pypy_interpreter_astcompiler.c", line 5965, in Module_walkabout
  File "pypy_interpreter_astcompiler.c", line 13374, in 
PythonCodeGenerator__handle_body
  File "pypy_interpreter_astcompiler_2.c", line 10804, in 
PythonCodeGenerator_visit_AnnAssign
  File "pypy_interpreter_astcompiler_2.c", line 15234, in 
PythonCodeGenerator_visit_ListComp
  File "pypy_interpreter_astcompiler_2.c", line 37308, in 
PythonCodeGenerator__compile_comprehension
  File "pypy_interpreter_astcompiler_2.c", line 35667, in 
PythonCodeGenerator_sub_scope
  File "pypy_interpreter_astcompiler.c", line 11360, in 
PythonCodeGenerator___init__
SystemError: unexpected internal exception (please report a bug): <KeyError 
object at 0x7fcc4f8c65c0>; internal traceback was dumped to stderr
```

Annotated variable assignments without comprehensions are fine:

```
$ ./pypy3 -c 'a: list = [1, 2, 3]; print(a)'
[1, 2, 3]
```


_______________________________________________
pypy-issue mailing list
pypy-issue@python.org
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to