forked from VimPlug/jedi
override annotation() in Lambda, instead of checking in Function on type
This commit is contained in:
@@ -879,9 +879,6 @@ class Function(ClassOrFunc):
|
|||||||
return bool(self.yields)
|
return bool(self.yields)
|
||||||
|
|
||||||
def annotation(self):
|
def annotation(self):
|
||||||
if self.children[0] == "lambda":
|
|
||||||
# lambda functions have no annotation
|
|
||||||
return None
|
|
||||||
try:
|
try:
|
||||||
if self.children[3] == "->":
|
if self.children[3] == "->":
|
||||||
return _fix_forward_reference(self.children[4])
|
return _fix_forward_reference(self.children[4])
|
||||||
@@ -964,6 +961,10 @@ class Lambda(Function):
|
|||||||
def is_generator(self):
|
def is_generator(self):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def annotation(self):
|
||||||
|
# lambda functions do not support annotations
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def yields(self):
|
def yields(self):
|
||||||
return []
|
return []
|
||||||
|
|||||||
Reference in New Issue
Block a user