[issue19557] ast - docs for every node type are missing
New submission from anatoly techtonik:
http://docs.python.org/2/library/ast.html
AST module doc is incomplete. To write node visitor, you need to know possible types of parameters and expected values for every node type. They are different.
http://hg.python.org/cpython/file/1ee45eb6aab9/Parser/Python.asdl
For example, visit_Assign expects:
Assign(targets, value)
`targets` can be List, Tuple or Name
When there is List, and when there is Tuple? It should be documented.
----------
assignee: docs@python
components: Devguide, Documentation
messages: 202675
nosy: docs@python, ezio.melotti, techtonik
priority: normal
severity: normal
status: open
title: ast - docs for every node type are missing
_______________________________________
Python tracker
Brett Cannon added the comment:
The node types are all listed right there in the docs in the abstract grammar section, so arguing they are incomplete I don't think is accurate.
I'm willing to leave this open in case some ambitious person wants to write docs for every node type, but I think this is a very low priority task.
----------
nosy: +brett.cannon
priority: normal -> low
_______________________________________
Python tracker
Changes by Terry J. Reedy
anatoly techtonik added the comment:
Neither you nor docs answer the question when Assign node gets Tuple as argument, when List and when Subscript.
While it is obvious to you, I personally don't know what a Subscript is. This is the kind of stuff that I'd like to see documented.
----------
_______________________________________
Python tracker
anatoly techtonik added the comment:
http://stackoverflow.com/questions/8370132/what-syntax-is-represented-by-an-...
----------
_______________________________________
Python tracker
Changes by Brett Cannon
anatoly techtonik added the comment:
https://greentreesnakes.readthedocs.org/en/latest/
----------
_______________________________________
Python tracker
Georg Brandl added the comment:
When citing a link, it's customary to give at least a comment *why* you are citing it.
----------
nosy: +georg.brandl
_______________________________________
Python tracker
anatoly techtonik added the comment:
SO link serves a proof that a problem is actual. It is needed, because, for example Brett doesn't think it is important.
2nd link is the same proof, and also an example of documentation wanted.
----------
_______________________________________
Python tracker
anatoly techtonik added the comment:
In fact it may be the documentation that could be merged.
----------
_______________________________________
Python tracker
Batuhan
Cheryl Sabella
participants (6)
-
anatoly techtonik
-
Batuhan
-
Brett Cannon
-
Cheryl Sabella
-
Georg Brandl
-
Terry J. Reedy