[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: The grammar presented in the doc is intentionally slightly simplified from the one actually used by the LL(1) parser. The parser has to know what type of statement it is parsing after the first token or so, so it needs a separate production (concept) for

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-23 Thread Jayanth Koushik
Jayanth Koushik added the comment: Oh ok. That makes sense. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22243 ___ ___ Python-bugs-list

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5496bf8972b6 by Terry Jan Reedy in branch '2.7': Issue #22243: fix except grammar in reference. http://hg.python.org/cpython/rev/5496bf8972b6 New changeset a249f1f879be by Terry Jan Reedy in branch '3.4': Issue #22243: fix except grammar in

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-23 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- resolution: - fixed stage: - resolved status: open - closed type: enhancement - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22243

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-22 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- keywords: +easy versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22243 ___

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-22 Thread Jayanth Koushik
Jayanth Koushik added the comment: The whole page on compound statements seems to be rife with inconsistencies. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22243 ___

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think 'target' can just be replaced by 'identifier'. Using 'expression' (or 'expr' in the ast doc) for what should be 'exceptions: identifier' or paranthesized tuple of identifiers;, is also too broad. However, that must be enforced in the compiler rather

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-22 Thread Michael Williamson
Michael Williamson added the comment: Using 'expression' (or 'expr' in the ast doc) for what should be 'exceptions: identifier' or paranthesized tuple of identifiers;, is also too broad. However, that must be enforced in the compiler rather than the parser, and compiler restrictions are

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: You are right, only the result, and not the form of 'expression' is constrained. I will let Jayanth propose other errors. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22243

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-22 Thread Jayanth Koushik
Jayanth Koushik added the comment: The page on compound statements defines compound statements as: compound_stmt ::= if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-21 Thread Michael Williamson
New submission from Michael Williamson: In the docs for the try statement [1], part of the grammar is: try1_stmt ::= try : suite (except [expression [as target]] : suite)+ [else : suite] [finally : suite] The `target` rule allows any assignable

[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-21 Thread Jayanth Koushik
Jayanth Koushik added the comment: Yes. Seems to be a documentation error. The full grammar specification [1] uses 'NAME' instead of 'target'. [1]: https://docs.python.org/3/reference/grammar.html -- nosy: +jayanthkoushik type: - enhancement ___