Skip to content

Strict equality false positive with Type[Any] #7823

Closed
@JukkaL

Description

@JukkaL

When using --strict-equality, the following program produces a false positive error, since Type[Any] should overlap with all type objects:

from typing import Any
data: Any = []

# Non-overlapping container check (element type: "Type[Any]", container item type: "ABCMeta")
print(type(data) in [dict, list])  # True

cc @ilevkivskyi

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions