From: Guido van Rossum Date: Mon, 28 Jan 2019 19:31:34 +0000 (-0800) Subject: Add comment clarifying the func_body_suite switcheroo X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98ee20a1775fb80dda11c6a69c033415a054b367;p=thirdparty%2FPython%2Fcpython.git Add comment clarifying the func_body_suite switcheroo --- 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; }