The Python Language Reference, Release 3.9.5 (continued from previous page) parameters: | slash_no_default param_no_default *param_with_default *[star_etc] | slash_with_defaultparam_with_default *[star_etc] | param_no_default +param_with_default *[star_etc] | param_with_default +[star_etc] | star_etc # Some duplication here because we can't write (',' | &')'), # which is because we don't support empty alternatives (yet). # slash_no_default : | param_no_default +'/' ',' | param_no_default +'/' &')' slash_with_default : | param_no_default *param_with_default +'/' ',' | param_no_default *param_with_default +'/' &')' star_etc: | '*' param_no_default param_maybe_default *[kwds] | '*' ',' param_maybe_default +[kwds] | kwds kwds: '**' param_no_default # One parameter. This *includes* a following comma and type comment. # # There are three styles: # - No default # - With default # - Maybe with default # # There are two alternative forms of each, to deal with type comments: # - Ends in a comma followed by an optional type comment # - No comma, optional type comment, must be followed by close paren # The latter form is for a final parameter without trailing comma. # param_no_default : | param ',' TYPE_COMMENT? | param TYPE_COMMENT ? &')' param_with_default : | param default',' TYPE_COMMENT? | param defaultTYPE_COMMENT ? &')' param_maybe_default : | param default? ',' TYPE_COMMENT? | param default? TYPE_COMMENT ? &')' param: NAME annotation? annotation: ':' expression default: '=' expression decorators: ('@' named_expressionNEWLINE ) + class_def : | decorators class_def_raw | class_def_raw class_def_raw : | 'class' NAME ['(' [ arguments] ')' ] ':' block block: | NEWLINE INDENT statementsDEDENT | simple_stmt star_expressions: (continues on next page) 110 Chapter 10. Full Grammar specification