[issue37083] Document TYPE_COMMENT in documentation reference for compound statements
New submission from Pablo Galindo Salgado <pablogsal@gmail.com>: The last changes in the grammar regarding TYPE_COMMENTS should be added to this section: https://docs.python.org/3/reference/compound_stmts.html#function-definitions ---------- assignee: docs@python components: Documentation messages: 343820 nosy: docs@python, gvanrossum, levkivskyi, pablogsal priority: normal severity: normal stage: needs patch status: open title: Document TYPE_COMMENT in documentation reference for compound statements type: behavior versions: Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue37083> _______________________________________
Pablo Galindo Salgado <pablogsal@gmail.com> added the comment: I will make a PR after https://github.com/python/cpython/pull/13202 is merged. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue37083> _______________________________________
Batuhan <batuhanosmantaskaya@gmail.com> added the comment: @pablogsal, PR 13202 is merged ---------- nosy: +BTaskaya _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue37083> _______________________________________
Change by Dong-hee Na <donghee.na92@gmail.com>: ---------- keywords: +patch pull_requests: +16696 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/17191 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue37083> _______________________________________
Guido van Rossum <guido@python.org> added the comment: Honestly I don't think that the exact places where TYPE_COMMENT goes in the grammar should be documented as part of the language reference. For almost all of them we should be using type annotation syntax, and IMO for the remaining ones we should either add syntax or just move the declaration to a line by itself using `var: type` (PEP 526). Also note that these are irrelevant to most users -- they only come into play when ast.parse(type_comments=True) is used, or when code is parsed by a separate tool like mypy. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue37083> _______________________________________
Pablo Galindo Salgado <pablogsal@gmail.com> added the comment: I am convinced by Guido's reasoning, I think we can close the issue. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue37083> _______________________________________
participants (4)
-
Batuhan
-
Dong-hee Na
-
Guido van Rossum
-
Pablo Galindo Salgado