Skip to content

Commit 62f511f

Browse files
committed
Add typing to FUNCTION symbol
1 parent faeb8c0 commit 62f511f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

symbols/function.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# This program is Free Software and is released under the terms of
99
# the GNU General License
1010
# ----------------------------------------------------------------------
11+
from typing import Optional
1112

1213
from api.constants import CLASS
1314
from api.constants import KIND
@@ -52,13 +53,13 @@ def set_kind(self, value, lineno):
5253
self.__kind = value
5354

5455
@property
55-
def params(self):
56+
def params(self) -> SymbolPARAMLIST:
5657
if not self.children:
5758
return SymbolPARAMLIST()
5859
return self.children[0]
5960

6061
@params.setter
61-
def params(self, value):
62+
def params(self, value: SymbolPARAMLIST):
6263
assert isinstance(value, SymbolPARAMLIST)
6364
if self.children is None:
6465
self.children = []
@@ -69,14 +70,14 @@ def params(self, value):
6970
self.children = [value]
7071

7172
@property
72-
def body(self):
73+
def body(self) -> SymbolBLOCK:
7374
if not self.children or len(self.children) < 2:
7475
self.body = SymbolBLOCK()
7576

7677
return self.children[1]
7778

7879
@body.setter
79-
def body(self, value):
80+
def body(self, value: Optional[SymbolBLOCK]):
8081
if value is None:
8182
value = SymbolBLOCK()
8283
assert isinstance(value, SymbolBLOCK)

0 commit comments

Comments
 (0)