Fix most import related mypy errors

This commit is contained in:
Peter Law
2020-07-21 23:30:26 +01:00
parent c09e21ae4b
commit 35c2d660cb
8 changed files with 42 additions and 11 deletions

View File

@@ -2,6 +2,22 @@ from jedi.inference.compiled.value import CompiledValue, CompiledName, \
CompiledValueFilter, CompiledValueName, create_from_access_path
from jedi.inference.base_value import LazyValueWrapper
__all__ = (
'CompiledValue',
'CompiledName',
'CompiledValueFilter',
'CompiledValueName',
'create_from_access_path',
'LazyValueWrapper',
'builtin_from_name',
'ExactValue',
'create_simple_object',
'get_string_value_set',
'load_module',
)
def builtin_from_name(inference_state, string):
typing_builtins_module = inference_state.builtins_module

View File

@@ -50,7 +50,7 @@ def _get_numpy_doc_string_cls():
global _numpy_doc_string_cache
if isinstance(_numpy_doc_string_cache, (ImportError, SyntaxError)):
raise _numpy_doc_string_cache
from numpydoc.docscrape import NumpyDocString
from numpydoc.docscrape import NumpyDocString # type: ignore[import]
_numpy_doc_string_cache = NumpyDocString
return _numpy_doc_string_cache

View File

@@ -5,7 +5,8 @@ from parso import python_bytes_to_unicode
from jedi.debug import dbg
from jedi.file_io import KnownContentFileIO
from jedi.inference.imports import SubModuleName, load_module_from_path
from jedi.inference.names import SubModuleName
from jedi.inference.imports import load_module_from_path
from jedi.inference.filters import ParserTreeFilter
from jedi.inference.gradual.conversion import convert_names

View File

@@ -4,3 +4,18 @@ from jedi.inference.value.function import FunctionValue, \
MethodValue
from jedi.inference.value.instance import AnonymousInstance, BoundMethod, \
CompiledInstance, AbstractInstanceValue, TreeInstance
__all__ = (
'ModuleValue',
'ClassValue',
'FunctionValue',
'MethodValue',
'AnonymousInstance',
'BoundMethod',
'CompiledInstance',
'AbstractInstanceValue',
'TreeInstance',
)

View File

@@ -1,6 +1,6 @@
from abc import abstractproperty
from parso.python.tree import search_ancestor
from parso.tree import search_ancestor
from jedi import debug
from jedi import settings