mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
PEP 3107 - Function Annotations thanks to Tony Lownds
This commit is contained in:
parent
f6657e67b3
commit
c150536b5e
32 changed files with 2855 additions and 1897 deletions
|
@ -10,7 +10,7 @@ module Python version "$Revision$"
|
|||
| Suite(stmt* body)
|
||||
|
||||
stmt = FunctionDef(identifier name, arguments args,
|
||||
stmt* body, expr* decorators)
|
||||
stmt* body, expr* decorators, expr? returns)
|
||||
| ClassDef(identifier name, expr* bases, stmt* body)
|
||||
| Return(expr? value)
|
||||
|
||||
|
@ -100,8 +100,12 @@ module Python version "$Revision$"
|
|||
excepthandler = (expr? type, expr? name, stmt* body, int lineno,
|
||||
int col_offset)
|
||||
|
||||
arguments = (expr* args, identifier? vararg, expr* kwonlyargs,
|
||||
identifier? kwarg, expr* defaults, expr* kw_defaults)
|
||||
arguments = (arg* args, identifier? vararg, expr? varargannotation,
|
||||
arg* kwonlyargs, identifier? kwarg,
|
||||
expr? kwargannotation, expr* defaults,
|
||||
expr* kw_defaults)
|
||||
arg = SimpleArg(identifier arg, expr? annotation)
|
||||
| NestedArgs(arg* args)
|
||||
|
||||
-- keyword arguments supplied to call
|
||||
keyword = (identifier arg, expr value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue