Skip to content

__import__ is incorectly typed for python 3.6. #4060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
igalic opened this issue Oct 5, 2017 · 3 comments
Closed

__import__ is incorectly typed for python 3.6. #4060

igalic opened this issue Oct 5, 2017 · 3 comments

Comments

@igalic
Copy link

igalic commented Oct 5, 2017

here's the function declaration:

def __import__(name, globals=None, locals=None, fromlist=(), level=0):

and here's mypy's type hints:

def __import__(name: str, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...,
               fromlist: List[str] = ..., level: int = -1) -> Any: ...

and here's what that should look like:

def __import__(name: str, globals: Optional[Dict[str, Any]] = ..., locals: Optional[Dict[str, Any]] = ...,
               fromlist: List[str] = ..., level: int = -1) -> Any: ...
@ilevkivskyi
Copy link
Member

This is not mypy's problem (typeshed stubs are shared by several type checkers), could you please instead open this issue on typeshed tracker?

@igalic
Copy link
Author

igalic commented Oct 5, 2017

argh, of course. thank you.


this seems to have been fixed in python/typeshed#1424
but doesn't seem to have been released yet


so i just realized that mypy bundles its own typeshed, so "all" it'd take to fix this bug is to forward the submodule ref and make a release of mypy itself.

@emmatyping
Copy link
Member

@igakic There are plans for a release Friday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants