mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
Name.is_definition implementation.
This commit is contained in:
@@ -238,6 +238,11 @@ class Name(_Leaf):
|
|||||||
def get_definition(self):
|
def get_definition(self):
|
||||||
return self.parent.get_parent_until((ArrayStmt, StatementElement, Node), reverse=True)
|
return self.parent.get_parent_until((ArrayStmt, StatementElement, Node), reverse=True)
|
||||||
|
|
||||||
|
def is_definition(self):
|
||||||
|
stmt = self.get_definition()
|
||||||
|
return isinstance(stmt, (ExprStmt, Import)) \
|
||||||
|
and self in stmt.get_defined_names()
|
||||||
|
|
||||||
def assignment_indexes(self):
|
def assignment_indexes(self):
|
||||||
"""
|
"""
|
||||||
Returns an array of ints of the indexes that are used in tuple
|
Returns an array of ints of the indexes that are used in tuple
|
||||||
|
|||||||
Reference in New Issue
Block a user