forked from VimPlug/jedi
Don't use the create function anymore in compiled
Now the whole creation of builtin objects is abstract and was moved to subprocesses etc.
This commit is contained in:
@@ -5,9 +5,16 @@ TODO Some parts of this module are still not well documented.
|
||||
from jedi.evaluate.context import ModuleContext
|
||||
from jedi.evaluate import compiled
|
||||
from jedi.evaluate.compiled import mixed
|
||||
from jedi.evaluate.compiled.access import create_access_path
|
||||
from jedi.evaluate.base_context import Context
|
||||
|
||||
|
||||
def _create(evaluator, obj):
|
||||
return compiled.create_from_access_path(
|
||||
evaluator, create_access_path(evaluator, obj)
|
||||
)
|
||||
|
||||
|
||||
class NamespaceObject(object):
|
||||
def __init__(self, dct):
|
||||
self.__dict__ = dct
|
||||
@@ -33,7 +40,7 @@ class MixedModuleContext(Context):
|
||||
yield filter
|
||||
|
||||
for namespace_obj in self._namespace_objects:
|
||||
compiled_object = compiled.create(self.evaluator, namespace_obj)
|
||||
compiled_object = _create(self.evaluator, namespace_obj)
|
||||
mixed_object = mixed.MixedObject(
|
||||
self.evaluator,
|
||||
parent_context=self,
|
||||
|
||||
@@ -16,12 +16,9 @@ def create_simple_object(evaluator, obj):
|
||||
versions.
|
||||
"""
|
||||
assert isinstance(obj, (int, float, str, bytes, slice, complex, type(Ellipsis)))
|
||||
return create(evaluator, obj)
|
||||
|
||||
|
||||
def create(evaluator, obj):
|
||||
return create_from_access_path(
|
||||
evaluator, access.create_access_path(evaluator, obj)
|
||||
evaluator,
|
||||
evaluator.compiled_subprocess.create_simple_object(obj)
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -17,3 +17,7 @@ def get_compiled_method_return(evaluator, id, attribute, *args, **kwargs):
|
||||
|
||||
def get_special_object(evaluator, identifier):
|
||||
return access.get_special_object(evaluator, identifier)
|
||||
|
||||
|
||||
def create_simple_object(evaluator, obj):
|
||||
return access.create_access_path(evaluator, obj)
|
||||
|
||||
Reference in New Issue
Block a user