pep0484 return type support

This commit is contained in:
Claude committed 2015-12-13 23:07:13 +01:00
1 parent 68cbabe819
commit 7e8112d607
4 files changed
+81 -9

No files matched your search

+3 -1
View File
@@ -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