forked from VimPlug/jedi
@@ -1230,7 +1230,15 @@ class Param(PythonBaseNode):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def position_nr(self):
|
def position_nr(self):
|
||||||
return self.parent.children.index(self) - 1
|
index = self.parent.children.index(self)
|
||||||
|
try:
|
||||||
|
keyword_only_index = self.parent.children.index('*')
|
||||||
|
if index > keyword_only_index:
|
||||||
|
# Skip the ` *, `
|
||||||
|
index -= 2
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
return index - 1
|
||||||
|
|
||||||
def get_parent_function(self):
|
def get_parent_function(self):
|
||||||
return search_ancestor(self, ('funcdef', 'lambda'))
|
return search_ancestor(self, ('funcdef', 'lambda'))
|
||||||
|
|||||||
@@ -158,3 +158,10 @@ Y = int
|
|||||||
def just_because_we_can(x: "flo" + "at"):
|
def just_because_we_can(x: "flo" + "at"):
|
||||||
#? float()
|
#? float()
|
||||||
x
|
x
|
||||||
|
|
||||||
|
|
||||||
|
def keyword_only(a: str, *, b: str):
|
||||||
|
#? ['startswith']
|
||||||
|
a.startswi
|
||||||
|
#? ['startswith']
|
||||||
|
b.startswi
|
||||||
|
|||||||
Reference in New Issue
Block a user