[issue37995] Multiline ast.dump()

2019-09-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue37995] Multiline ast.dump()

2019-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 850573b836d5b82d1a1ebe75a635aaa0a3dff997 by Serhiy Storchaka in branch 'master': bpo-37995: Add an option to ast.dump() to produce a multiline output. (GH-15631) https://github.com/python/cpython/commit/850573b836d5b82d1a1ebe75a635aaa0a3dff997

[issue37995] Multiline ast.dump()

2019-09-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > It would be great is the tool wasn't tightly bound to our particular AST and > could be used for any hand-rolled AST. I do not think it is possible. Every tree has its specifics: what types of nodes are supported (AST, list and primitive immutable values

[issue37995] Multiline ast.dump()

2019-09-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: Much better. I prefer the first version with closers on the last item. -- nosy: +terry.reedy ___ Python tracker ___

[issue37995] Multiline ast.dump()

2019-09-01 Thread Raymond Hettinger
Change by Raymond Hettinger : Added file: https://bugs.python.org/file48580/ast_bloop.py ___ Python tracker ___ ___ Python-bugs-list mailing

[issue37995] Multiline ast.dump()

2019-09-01 Thread Raymond Hettinger
Change by Raymond Hettinger : Removed file: https://bugs.python.org/file48579/ast_bloop.py ___ Python tracker ___ ___ Python-bugs-list maili

[issue37995] Multiline ast.dump()

2019-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: It would be great is the tool wasn't tightly bound to our particular AST and could be used for any hand-rolled AST. -- ___ Python tracker ___

[issue37995] Multiline ast.dump()

2019-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I wrote a generic AST pretty printer for a personal compiler project (see attached file). Perhaps it can be adapted to the Python AST. ## Example input ### Program(procs=[Procedure(name='FACTORIAL', params=['N'], is_test

[issue37995] Multiline ast.dump()

2019-08-31 Thread Anthony Sottile
Anthony Sottile added the comment: neat, this looks like a similar api to astpretty: https://github.com/asottile/astpretty -- nosy: +Anthony Sottile ___ Python tracker ___ __

[issue37995] Multiline ast.dump()

2019-08-31 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue37995] Multiline ast.dump()

2019-08-31 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15299 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15631 ___ Python tracker ___

[issue37995] Multiline ast.dump()

2019-08-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue36287. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37995] Multiline ast.dump()

2019-08-31 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : ast.dump() is mainly useful for debugging purposes. Unfortunately the output is too long and complex even for simple examples. It contains too much nested calls and lists. >>> import ast >>> node = ast.parse('spam(eggs, "and cheese")') >>> print(ast.dum