1
0
forked from VimPlug/jedi

Make sure staticmethod params are (mostly) inferred correctly, fixes #735

This commit is contained in:
Dave Halter
2019-12-24 21:28:30 +01:00
parent 7a988d9d8b
commit 110d89724e
3 changed files with 45 additions and 1 deletions

View File

@@ -295,3 +295,11 @@ def cut_value_at_position(leaf, position):
def get_string_quote(leaf):
return re.match(r'\w*("""|\'{3}|"|\')', leaf.value).group(1)
def function_is_static_method(function_node):
for decorator in function_node.get_decorators():
dotted_name = decorator.children[1]
if dotted_name.get_code() == 'staticmethod':
return True
return False