forked from VimPlug/jedi
Remove stuff from CompiledObject that didn't belong there and wasn't used
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
"""
|
"""
|
||||||
Imitate the parser representation.
|
Imitate the parser representation.
|
||||||
"""
|
"""
|
||||||
import inspect
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@@ -15,7 +14,7 @@ from jedi.evaluate.filters import AbstractFilter, AbstractNameDefinition, \
|
|||||||
ContextNameMixin
|
ContextNameMixin
|
||||||
from jedi.evaluate.base_context import Context, ContextSet
|
from jedi.evaluate.base_context import Context, ContextSet
|
||||||
from jedi.evaluate.lazy_context import LazyKnownContext
|
from jedi.evaluate.lazy_context import LazyKnownContext
|
||||||
from jedi.evaluate.compiled.access import DirectObjectAccess, _sentinel, create_access
|
from jedi.evaluate.compiled.access import _sentinel, create_access
|
||||||
from jedi.evaluate.cache import evaluator_function_cache
|
from jedi.evaluate.cache import evaluator_function_cache
|
||||||
from . import fake
|
from . import fake
|
||||||
|
|
||||||
@@ -52,19 +51,12 @@ class CheckAttribute(object):
|
|||||||
|
|
||||||
|
|
||||||
class CompiledObject(Context):
|
class CompiledObject(Context):
|
||||||
path = None # modules have this attribute - set it to None.
|
|
||||||
used_names = lambda self: {} # To be consistent with modules.
|
|
||||||
|
|
||||||
def __init__(self, evaluator, access, parent_context=None, faked_class=None):
|
def __init__(self, evaluator, access, parent_context=None, faked_class=None):
|
||||||
super(CompiledObject, self).__init__(evaluator, parent_context)
|
super(CompiledObject, self).__init__(evaluator, parent_context)
|
||||||
self.access = access
|
self.access = access
|
||||||
# This attribute will not be set for most classes, except for fakes.
|
# This attribute will not be set for most classes, except for fakes.
|
||||||
self.tree_node = faked_class
|
self.tree_node = faked_class
|
||||||
|
|
||||||
def get_root_node(self):
|
|
||||||
# To make things a bit easier with filters we add this method here.
|
|
||||||
return self.get_root_context()
|
|
||||||
|
|
||||||
@CheckAttribute
|
@CheckAttribute
|
||||||
def py__call__(self, params):
|
def py__call__(self, params):
|
||||||
if self.tree_node is not None and self.tree_node.type == 'funcdef':
|
if self.tree_node is not None and self.tree_node.type == 'funcdef':
|
||||||
@@ -203,12 +195,6 @@ class CompiledObject(Context):
|
|||||||
for type_ in docstrings.infer_return_types(self):
|
for type_ in docstrings.infer_return_types(self):
|
||||||
yield type_
|
yield type_
|
||||||
|
|
||||||
def get_self_attributes(self):
|
|
||||||
return [] # Instance compatibility
|
|
||||||
|
|
||||||
def get_imports(self):
|
|
||||||
return [] # Builtins don't have imports
|
|
||||||
|
|
||||||
def dict_values(self):
|
def dict_values(self):
|
||||||
return ContextSet.from_iterable(
|
return ContextSet.from_iterable(
|
||||||
_create_from_access(self.evaluator, access) for access in self.access.dict_values()
|
_create_from_access(self.evaluator, access) for access in self.access.dict_values()
|
||||||
|
|||||||
Reference in New Issue
Block a user