This is the convention according to my expertise:
> PascalCase: subtype of a token type, cannot be used in a `rule_name[type]:`
> definition in grammar
> lower_snake_case: a token type
PascalCase nodes are those used in the functions `_PyAST_*` (or one of the
expression contexts), while lower_snake_case nodes are used in the `*_ty` ones.
For example, the `arg` node:
> kwds[arg_ty]: '**' a=param_no_default { a }
And the `FunctionDef` node:
> | 'def' n=NAME '(' params=[params] ')' a=['->' z=expression { z }] &&':'
> tc=[func_type_comment] b=block {
> _PyAST_FunctionDef(n->v.Name.id,
> (params) ? params : CHECK(arguments_ty,
> _PyPegen_empty_arguments(p)),
> b, NULL, a, NEW_TYPE_COMMENT(p, tc), EXTRA) }
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/XSERXCF7LJ6IEYBD54ATEP2VROLSUI4Q/
Code of Conduct: http://python.org/psf/codeofconduct/