Issue 37248: support conversion of `func(**{} if a else b)`

Issue37248

Created on 2019-06-12 12:15 by Shen Han, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (7)
msg345354 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-06-12 13:40
Please, can you add some text with an explanation ?
msg345361 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-06-12 14:11
From the title is this similar to the PR https://github.com/python/cpython/pull/12703
msg345437 - (view) Author: (Shen Han) * Date: 2019-06-13 00:23
The 2to3 tool cannot convert the following code:
 1. `func(**{} if a else b)`
 2. `func(*[] if a else b)`

I think that problem is rooted the outdated Grammar.txt.
msg345438 - (view) Author: (Shen Han) * Date: 2019-06-13 00:24
This PR https://github.com/python/cpython/pull/12703 solves this problem. But haven't been merged.
msg345452 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-06-13 03:36
https://bugs.python.org/issue36541 already tracks it. So can this be closed as a duplicate?
msg345678 - (view) Author: (Shen Han) * Date: 2019-06-15 12:14
Yes, I think so.
msg345679 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-06-15 12:16
Thanks for the report. Closing.
History
Date User Action Args
2022-04-11 14:59:16adminsetgithub: 81429
2019-06-15 12:16:16xtreaksetresolution: duplicate
2019-06-15 12:16:09xtreaksetstatus: open -> closed
superseder: Make lib2to3 grammar better match Python, support the := walrus
messages: + msg345679

stage: resolved

2019-06-15 12:14:27Shen Hansetmessages: + msg345678
2019-06-13 03:36:35xtreaksetmessages: + msg345452
2019-06-13 00:24:25Shen Hansetmessages: + msg345438
2019-06-13 00:23:05Shen Hansetmessages: + msg345437
2019-06-12 14:11:26xtreaksetnosy: + xtreak
messages: + msg345361
2019-06-12 13:40:47pablogsalsetnosy: + pablogsal
messages: + msg345354
2019-06-12 12:15:53Shen Hancreate