1
0
forked from VimPlug/jedi

position_nr -> position_index

This commit is contained in:
Dave Halter
2017-04-30 14:12:30 +02:00
parent 2383f5c0a0
commit 0f1570f682
3 changed files with 9 additions and 8 deletions

View File

@@ -963,7 +963,10 @@ class Param(PythonBaseNode):
return self._tfpdef()
@property
def position_nr(self):
def position_index(self):
"""
Returns the positional index of a paramter.
"""
index = self.parent.children.index(self)
try:
keyword_only_index = self.parent.children.index('*')
@@ -975,6 +978,9 @@ class Param(PythonBaseNode):
return index - 1
def get_parent_function(self):
"""
Returns the function/lambda a paramter is defined in.
"""
return search_ancestor(self, ('funcdef', 'lambdef'))
def get_description(self):