1
0
forked from VimPlug/jedi

Replace some isinstance checks in the parser tree with .type checks.

This commit is contained in:
Dave Halter
2015-02-09 12:27:29 +01:00
parent a9a3387cb0
commit a095f8d9e0
4 changed files with 17 additions and 13 deletions

View File

@@ -565,6 +565,8 @@ class FunctionExecution(Executed):
multiple calls to functions and recursion has to be avoided. But this is
responsibility of the decorators.
"""
type = 'funcdef'
def __init__(self, evaluator, base, *args, **kwargs):
super(FunctionExecution, self).__init__(evaluator, base, *args, **kwargs)
# for deep_ast_copy
@@ -646,7 +648,7 @@ class FunctionExecution(Executed):
return objects
def __getattr__(self, name):
if name not in ['start_pos', 'end_pos', 'imports', '_sub_module', 'type']:
if name not in ['start_pos', 'end_pos', 'imports', 'name', 'type']:
raise AttributeError('Tried to access %s: %s. Why?' % (name, self))
return getattr(self.base, name)