mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +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
|
@ -12,8 +12,11 @@
|
|||
Module: doc*, node
|
||||
Stmt: nodes!
|
||||
Decorators: nodes!
|
||||
Function: decorators&, name*, argnames*, defaults!, kwonlyargs*, flags*, doc*, code
|
||||
Lambda: argnames*, defaults!, kwonlyargs*, flags*, code
|
||||
Function: decorators&, name*, arguments!, defaults!, kwonlyargs!, returns&, flags*, doc*, code
|
||||
Lambda: arguments!, defaults!, kwonlyargs!, flags*, code
|
||||
SimpleArg: name*, annotation&
|
||||
NestedArgs: args!
|
||||
Kwarg: arg, expr
|
||||
Class: name*, bases!, doc*, code
|
||||
Pass:
|
||||
Break:
|
||||
|
@ -93,9 +96,10 @@ init(Lambda):
|
|||
self.varargs = 1
|
||||
if flags & CO_VARKEYWORDS:
|
||||
self.kwargs = 1
|
||||
self.returns = None
|
||||
|
||||
init(GenExpr):
|
||||
self.argnames = ['.0']
|
||||
self.arguments = [SimpleArg('.0', None)]
|
||||
self.varargs = self.kwargs = None
|
||||
self.kwonlyargs = ()
|
||||
|
||||
|
|
|
@ -266,7 +266,10 @@ class Node:
|
|||
pass # implemented by subclasses
|
||||
|
||||
class EmptyNode(Node):
|
||||
pass
|
||||
def getChildNodes(self):
|
||||
return ()
|
||||
def getChildren(self):
|
||||
return ()
|
||||
|
||||
class Expression(Node):
|
||||
# Expression is an artificial node class to support "eval"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue