pep0484 return type support
This commit is contained in:
1 parent
68cbabe819
commit
7e8112d607
4 files changed
+81
-9
No files matched your search
+3
-1
@@ -866,7 +866,9 @@ class Function(ClassOrFunc):
|
||||
|
||||
def annotation(self):
|
||||
try:
|
||||
return self.children[6] # 6th element: def foo(...) -> bar
|
||||
if self.children[3] == "->":
|
||||
return self.children[4]
|
||||
assert self.children[3] == ":"
|
||||
except IndexError:
|
||||
return None
|
||||
|
||||
|
||||
Reference in new issue
Block a user