Allow classes to be defined with empty parentheses. This means that

``class C(): pass`` is no longer a syntax error.
This commit is contained in:
Brett Cannon 2005-03-05 06:47:57 +00:00
parent 653a5adcca
commit 409d8f2ebd
4 changed files with 14 additions and 9 deletions

View file

@ -99,7 +99,7 @@ testlist: test (',' test)* [',']
testlist_safe: test [(',' test)+ [',']]
dictmaker: test ':' test (',' test ':' test)* [',']
classdef: 'class' NAME ['(' testlist ')'] ':' suite
classdef: 'class' NAME ['(' [testlist] ')'] ':' suite
arglist: (argument ',')* (argument [',']| '*' test [',' '**' test] | '**' test)
argument: [test '='] test [gen_for] # Really [keyword '='] test