New submission from Thomas Caswell:

On the current tip (changeset: 96023:4b5461dcd190) the following results in a 
syntax error

def test(a='a', b='b'):
    print(a, b)

opta = dict()
optb = dict(a=1, b=2)
test(**(opta or {}))  # <- works on all python
test(**optb or {})    # <- fails on current hg tip


This is suspected to be a result of 
https://hg.python.org/cpython/rev/a65f685ba8c0 

This was reported as an issue against sphinx 
(https://github.com/sphinx-doc/sphinx/pull/1889) and I was redirected here.

As suggested by Robert Lehmann suggests the issue is 
https://hg.python.org/cpython/rev/a65f685ba8c0#l1.33 which should be `** test`. 
 Making this change prevents the syntax error (patch attached).

----------
components: Interpreter Core
files: unpack_grammar.patch
keywords: patch
messages: 243087
nosy: tcaswell
priority: normal
severity: normal
status: open
title: Incorrect parsing of unpacked expressions in call
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file39359/unpack_grammar.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24176>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to