Skip to content

Regression: type inference can fall back to List[<nothing>] #8090

Closed
@JukkaL

Description

@JukkaL

Previously if mypy couldn't infer a type for a variable, it would fall back to a type such as List[Any] instead of List[<nothing>]. However, #8036 accidentally changed this, as can be seen from this example:

x = []  # type: ignore
print(x)
x = []
reveal_type(x)    # List[<nothing>] (used to be List[Any])

We should revert to the old behavior.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions