This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Adding new types to parser/unparse.py
Type: enhancement Stage: resolved
Components: Demos and Tools Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, ju-sh, pablogsal, serhiy.storchaka
Priority: normal Keywords:

Created on 2019-11-05 18:17 by ju-sh, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg356050 - (view) Author: Julin (ju-sh) * Date: 2019-11-05 18:17
The parser/unparse.py file lacks functions to handle the `Str`, `Num`, `Bytes` and `NameConstant` types.

Can we add them since it seems to be simple enough?
msg356051 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-11-05 18:21
These types are obsolete. The compiler never generates an AST tree containing them.
msg356052 - (view) Author: Julin (ju-sh) * Date: 2019-11-05 18:26
Okay. 

But can lines like

    if first:first = False
    else: self.write(", ")

be changed to span across more number of lines?

Because things like

    first:first

looks like a type hint.
msg357686 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2019-12-01 19:09
> be changed to span across more number of lines?
Yes, that changed in ast._Unparser, and i agree with Serhiy. There is no need for supporting that old constant nodes. IMHO this issue can be closed
msg357691 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-12-01 19:59
We usually do not accept cosmetic changes. If these lines be changed for other reasons (fixing a bug, adding new feature), their style can be changed.
History
Date User Action Args
2022-04-11 14:59:22adminsetgithub: 82883
2019-12-01 19:59:06serhiy.storchakasetstatus: open -> closed
resolution: rejected
messages: + msg357691

stage: resolved
2019-12-01 19:09:22BTaskayasetnosy: + pablogsal, BTaskaya
messages: + msg357686
2019-11-05 18:26:38ju-shsetmessages: + msg356052
2019-11-05 18:21:24serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg356051
2019-11-05 18:17:06ju-shcreate