mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
search_ancestor docstring
This commit is contained in:
@@ -3,6 +3,14 @@ from jedi._compatibility import utf8_repr, encoding, is_py3
|
||||
|
||||
|
||||
def search_ancestor(node, node_type_or_types):
|
||||
"""
|
||||
Recursively looks at the parents of a node and checks if the type names
|
||||
match.
|
||||
|
||||
:param node: The node that is looked at.
|
||||
:param node_type_or_types: A tuple or a string of type names that are
|
||||
searched for.
|
||||
"""
|
||||
if not isinstance(node_type_or_types, (list, tuple)):
|
||||
node_type_or_types = (node_type_or_types,)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user