From 98ee20a1775fb80dda11c6a69c033415a054b367 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 28 Jan 2019 11:31:34 -0800 Subject: [PATCH] Add comment clarifying the func_body_suite switcheroo --- Parser/parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Parser/parser.c b/Parser/parser.c index b082afca27b6..fa4a8f011ff5 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -263,6 +263,9 @@ PyParser_AddToken(parser_state *ps, int type, char *str, int arrow = x & ((1<<7)-1); dfa *d1; if (nt == func_body_suite && !(ps->p_flags & PyCF_TYPE_COMMENTS)) { + /* When parsing type comments is not requested, + we can provide better errors about bad indentation + by using 'suite' for the body of a funcdef */ D(printf(" [switch func_body_suite to suite]")); nt = suite; } -- 2.47.3