mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-04 18:32:44 +08:00
Fix final gradual typing related issues
This commit is contained in:
@@ -139,7 +139,7 @@ def _search_function_executions(inference_state, module_context, funcdef, string
|
|||||||
if i * inference_state.dynamic_params_depth > MAX_PARAM_SEARCHES:
|
if i * inference_state.dynamic_params_depth > MAX_PARAM_SEARCHES:
|
||||||
return
|
return
|
||||||
|
|
||||||
random_context = inference_state.create_context(for_mod_context, name)
|
random_context = for_mod_context.create_context(name)
|
||||||
for function_execution in _check_name_for_execution(
|
for function_execution in _check_name_for_execution(
|
||||||
inference_state, random_context, compare_node, name, trailer):
|
inference_state, random_context, compare_node, name, trailer):
|
||||||
found_executions = True
|
found_executions = True
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ class TypingValue(_BaseTypingValue):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class _TypingClassMixin(object):
|
class _TypingClassMixin(ClassMixin):
|
||||||
def py__bases__(self):
|
def py__bases__(self):
|
||||||
return [LazyKnownValues(
|
return [LazyKnownValues(
|
||||||
self.inference_state.builtins_module.py__getattribute__('object')
|
self.inference_state.builtins_module.py__getattribute__('object')
|
||||||
@@ -214,11 +214,11 @@ class _TypingClassMixin(object):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
class TypingClassValueWithIndex(_TypingClassMixin, ClassMixin, TypingValueWithIndex):
|
class TypingClassValueWithIndex(_TypingClassMixin, TypingValueWithIndex):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class TypingClassValue(_TypingClassMixin, TypingValue, ClassMixin):
|
class TypingClassValue(_TypingClassMixin, TypingValue):
|
||||||
index_class = TypingClassValueWithIndex
|
index_class = TypingClassValueWithIndex
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -536,7 +536,7 @@ def get_module_contexts_containing_name(inference_state, module_contexts, name):
|
|||||||
m = _load_module_from_path(inference_state, new_file_io, base_names)
|
m = _load_module_from_path(inference_state, new_file_io, base_names)
|
||||||
if isinstance(m, compiled.CompiledObject):
|
if isinstance(m, compiled.CompiledObject):
|
||||||
return None
|
return None
|
||||||
return m
|
return m.as_context()
|
||||||
|
|
||||||
# skip non python modules
|
# skip non python modules
|
||||||
used_mod_paths = set()
|
used_mod_paths = set()
|
||||||
|
|||||||
Reference in New Issue
Block a user