Issue 24176: Incorrect parsing of unpacked expressions in call (original) (raw)

Issue24176

Created on 2015-05-13 14:07 by tcaswell, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
unpack_grammar.patch tcaswell,2015-05-13 14:07 review
Messages (2)
msg243087 - (view) Author: Thomas Caswell (tcaswell) * Date: 2015-05-13 14:07
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).
msg243316 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-05-16 13:45
New changeset 38b2307372bf by Benjamin Peterson in branch 'default': allow test node after ** in calls (closes #24176) https://hg.python.org/cpython/rev/38b2307372bf
History
Date User Action Args
2022-04-11 14:58:16 admin set github: 68364
2015-05-16 13:45:05 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: resolved
2015-05-13 14:21:43 yselivanov set nosy: + benjamin.peterson, yselivanov
2015-05-13 14:07:25 tcaswell create