classification
Title: Allow `ast.unparse` to handle NaNs and empty sets
Type: enhancement Stage: resolved
Components: Versions: Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, Kodiologist, miss-islington, rhettinger
Priority: normal Keywords: patch

Created on 2021-03-16 19:39 by Kodiologist, last changed 2021-03-18 22:52 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 24897 merged Kodiologist, 2021-03-16 19:41
PR 24921 merged miss-islington, 2021-03-18 17:36
Messages (4)
msg388872 - (view) Author: (Kodiologist) * Date: 2021-03-16 19:39
`ast.unparse` throws an error on an empty set, and it produces `nan` for NaN, which isn't a legal Python literal.

PR to follow shortly.
msg388874 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2021-03-16 19:54
The reason that we weren't support these cases was there were simply no way achieve them by parsing code so we simply ignored (empty sets etc). Though considering that you have a decent use case in hy, I'd agree that these small additions are viable.
msg389032 - (view) Author: miss-islington (miss-islington) Date: 2021-03-18 17:36
New changeset 08ff4369afca84587b1c82034af4e9f64caddbf2 by Kodi Arfer in branch 'master':
bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897)
https://github.com/python/cpython/commit/08ff4369afca84587b1c82034af4e9f64caddbf2
msg389046 - (view) Author: miss-islington (miss-islington) Date: 2021-03-18 22:51
New changeset e8e341993e3f80a3c456fb8e0219530c93c13151 by Miss Islington (bot) in branch '3.9':
bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897)
https://github.com/python/cpython/commit/e8e341993e3f80a3c456fb8e0219530c93c13151
History
Date User Action Args
2021-03-18 22:52:29pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-03-18 22:51:56miss-islingtonsetmessages: + msg389046
2021-03-18 17:36:47miss-islingtonsetpull_requests: + pull_request23685
2021-03-18 17:36:22miss-islingtonsetnosy: + miss-islington
messages: + msg389032
2021-03-18 00:08:45rhettingersetnosy: + rhettinger
2021-03-16 19:54:47BTaskayasetmessages: + msg388874
2021-03-16 19:47:59BTaskayasetnosy: + BTaskaya
2021-03-16 19:41:11Kodiologistsetkeywords: + patch
stage: patch review
pull_requests: + pull_request23662
2021-03-16 19:39:06Kodiologistcreate