Fix final gradual typing related issues

This commit is contained in:
Dave Halter
2019-08-19 19:43:45 +02:00
parent b19ba12566
commit caee8e9952
3 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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()