This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Document TYPE_COMMENT in documentation reference for compound statements
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.8
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: docs@python Nosy List: BTaskaya, docs@python, gvanrossum, levkivskyi, pablogsal
Priority: normal Keywords: patch

Created on 2019-05-28 21:37 by pablogsal, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17191 closed corona10, 2019-11-16 16:08
Messages (5)
msg343820 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-05-28 21:37
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
msg343821 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-05-28 21:39
I will make a PR after https://github.com/python/cpython/pull/13202 is merged.
msg356735 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2019-11-16 00:06
@pablogsal, PR 13202 is merged
msg356762 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2019-11-16 17:48
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.
msg356933 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-11-18 23:43
I am convinced by Guido's reasoning, I think we can close the issue.
History
Date User Action Args
2022-04-11 14:59:15adminsetgithub: 81264
2019-11-18 23:43:14pablogsalsetstatus: open -> closed
resolution: rejected
messages: + msg356933

stage: patch review -> resolved
2019-11-16 17:48:12gvanrossumsetmessages: + msg356762
2019-11-16 16:08:04corona10setkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request16696
2019-11-16 00:06:05BTaskayasetnosy: + BTaskaya
messages: + msg356735
2019-05-28 21:39:30pablogsalsetmessages: + msg343821
2019-05-28 21:37:48pablogsalcreate