mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
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:
parent
653a5adcca
commit
409d8f2ebd
4 changed files with 14 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue