Skip to content

__import__ is incorectly typed for python 3.6. #4060

Closed
@igalic

Description

@igalic

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: ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions