Issue 37083: Document TYPE_COMMENT in documentation reference for compound statements (original) (raw)

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.