]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add comment clarifying the func_body_suite switcheroo
authorGuido van Rossum <guido@python.org>
Mon, 28 Jan 2019 19:31:34 +0000 (11:31 -0800)
committerGuido van Rossum <guido@python.org>
Mon, 28 Jan 2019 19:31:34 +0000 (11:31 -0800)
Parser/parser.c

index b082afca27b6240e22666e970162dbc1f741df10..fa4a8f011ff525193b31dd5187ace3ebc61a385b 100644 (file)
@@ -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;
                     }