1
0
forked from VimPlug/jedi

Remove IsScope in favor of an is_scope function.

This function was partially implemented anway. Now we've also added a function called 'get_parent_scope', to make it easy to get a scope of a Call, Statement, whatever.
This commit is contained in:
Dave Halter
2014-08-12 01:19:19 +02:00
parent 1865284fa9
commit 33e5a3280a
8 changed files with 53 additions and 27 deletions

View File

@@ -10,7 +10,7 @@ from jedi._compatibility import builtins as _builtins, unicode
from jedi import debug
from jedi.cache import underscore_memoization, memoize
from jedi.evaluate.sys_path import get_sys_path
from jedi.parser.representation import Param, SubModule, Base, IsScope, Operator
from jedi.parser.representation import Param, SubModule, Base, Operator
from jedi.evaluate.helpers import FakeName
from . import fake
@@ -374,12 +374,15 @@ def _parse_function_doc(doc):
return param_str, ret
class Builtin(CompiledObject, IsScope):
class Builtin(CompiledObject, Base):
@memoize
def get_by_name(self, name):
item = [n for n in self.get_defined_names() if n.get_code() == name][0]
return item.parent
def is_scope(self):
return True
def _a_generator(foo):
"""Used to have an object to return for generators."""