From 0e201810fa5b466fdf128044e78026528db9e8d2 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 3 Sep 2017 00:41:39 +0200 Subject: [PATCH] Remove the old get_definition function. --- parso/python/tree.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/parso/python/tree.py b/parso/python/tree.py index 5efc3bc..1e0ab59 100644 --- a/parso/python/tree.py +++ b/parso/python/tree.py @@ -78,25 +78,6 @@ class PythonMixin(object): """ __slots__ = () - def get_definition(self): - if self.type in ('newline', 'endmarker'): - raise ValueError('Cannot get the indentation of whitespace or indentation.') - - scope = self - while scope.parent is not None: - parent = scope.parent - if isinstance(scope, (PythonNode, PythonLeaf)) and parent.type not in ('simple_stmt', 'file_input'): - if scope.type == 'testlist_comp': - try: - if scope.children[1].type == 'comp_for': - return scope.children[1] - except IndexError: - pass - scope = parent - else: - break - return scope - def get_name_of_position(self, position): for c in self.children: if isinstance(c, Leaf):