classification
Title: ast.dump(indent=True) prettyprinting
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Multiline ast.dump()
View: 37995
Assigned To: Nosy List: BTaskaya, berker.peksag, techtonik
Priority: low Keywords:

Created on 2013-11-10 05:16 by techtonik, last changed 2019-12-01 18:58 by serhiy.storchaka. This issue is now closed.

Messages (3)
msg202506 - (view) Author: anatoly techtonik (techtonik) Date: 2013-11-10 05:16
ast.dump needs an indent argument for pretty printing.

  from pprint import pprint as pp
  pp(ast.dump(node))

  "Assign(targets=[Tuple(elts=[Name(id='d', ctx=Store()), Name(id='m', ctx=Store())], ctx=Store())], value=Call(func=Name(id='divmod', ctx=Load()), args=[Call(func=Name(id='len', ctx=Load()), args=[Name(id='seq', ctx=Load())], keywords=[], starargs=None, kwargs=None), Name(id='size', ctx=Load())], keywords=[], starargs=None, kwargs=None))"
msg203400 - (view) Author: anatoly techtonik (techtonik) Date: 2013-11-19 17:07
Implemented more advanced interface with filtering and tests - here - https://bitbucket.org/techtonik/astdump/

Right now the output is not so detailed, but it may change if the need arises.
msg357685 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2019-12-01 18:54
issue 37995 has added pretty printing to the ast.dump, IMHO this issue can be closed.
History
Date User Action Args
2019-12-01 18:58:56serhiy.storchakasetstatus: open -> closed
superseder: Multiline ast.dump()
resolution: duplicate
stage: test needed -> resolved
2019-12-01 18:54:10BTaskayasetnosy: + BTaskaya
messages: + msg357685
2015-03-14 23:26:01berker.peksagsetnosy: + berker.peksag
2013-11-19 17:07:35techtoniksetmessages: + msg203400
2013-11-11 14:52:51brett.cannonsetpriority: normal -> low
assignee: docs@python ->
components: + Library (Lib), - Documentation
versions: + Python 3.4
nosy: - docs@python

type: enhancement
stage: test needed
2013-11-10 05:16:58techtonikcreate