Author: Raffael Tfirst <raffael.tfi...@gmail.com> Branch: py3.5 Changeset: r84823:6192dedbd81c Date: 2016-05-29 22:06 +0200 http://bitbucket.org/pypy/pypy/changeset/6192dedbd81c/
Log: Start defining BUILD_SET_UNPACK as in cpython, undo temporary error bypass in visit_Starred, change error message if starred expression not used as store to match cpython 3.5 diff --git a/pypy/interpreter/astcompiler/assemble.py b/pypy/interpreter/astcompiler/assemble.py --- a/pypy/interpreter/astcompiler/assemble.py +++ b/pypy/interpreter/astcompiler/assemble.py @@ -676,6 +676,9 @@ def _compute_BUILD_SET(arg): return 1 - arg +def _compute_BUILD_SET_UNPACK(arg): + return 1 - arg + def _compute_BUILD_MAP(arg): return 1 - 2 * arg diff --git a/pypy/interpreter/astcompiler/codegen.py b/pypy/interpreter/astcompiler/codegen.py --- a/pypy/interpreter/astcompiler/codegen.py +++ b/pypy/interpreter/astcompiler/codegen.py @@ -1049,11 +1049,10 @@ self.emit_op_arg(op, elt_count) def visit_Starred(self, star): - if star.ctx != ast.Load: - if star.ctx != ast.Store: - self.error("can use starred expression only as assignment target", - star) - self.error("starred assignment target must be in a list or tuple", star) + if star.ctx != ast.Store: + self.error("can't use starred expression here", + star) + self.error("starred assignment target must be in a list or tuple", star) def visit_Tuple(self, tup): self.update_position(tup.lineno) diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py --- a/pypy/interpreter/pyopcode.py +++ b/pypy/interpreter/pyopcode.py @@ -1324,7 +1324,7 @@ self.space.call_method(w_set, 'add', w_item) self.pushvalue(w_set) - #BUILD_SET_UNPACK (and undo LOAD permit in codegen visit_starred) + #BUILD_SET_UNPACK (also as opcode) ### ____________________________________________________________ ### _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit