[docs] In the language specification for python 3.x, 8 Compound statements it reads

Carsten Klein carstenklein at yahoo.de
Mon Oct 29 19:25:33 CET 2012


For the funcdef, and even the inheritance parameter list on the classdef, which all boil down to the parameter_list,
it reads

classdef  ::=  [decorators] "class" classname [inheritance] ":" suite inheritance ::=  "(" [parameter_list] ")"

[...]

funcdef  ::=  [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite


[...]

parameter_list ::=  (defparameter ",")* ( "*" [parameter] ("," defparameter)* ["," "**" parameter] | "**" parameter | defparameter [","] )

Now, this makes me think of positional and non positional parameters and the metaclass keyword parameter with additional
keyword parameters being rejected by the engine when place in a class' inheritance parameter list.

The above rules do not really make that much sense, don't you think?
 

Wouldn't the below rules be more appropriate?


inheritance ::=  "(" ((identifier | expression) ",")* ["metaclass" "=" identifier] ")"

parameter_list ::= "(" (parameter ",")* [ "*" parameter "," ] (defparameter ",")* [ "**" parameter ] ")"


Cheers


Carsten Klein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20121029/05cac853/attachment-0001.html>


More information about the docs mailing list