Skip to content

Set difference unexpectedly permissive #1840

Closed
@chadaustin

Description

@chadaustin

Mypy passes accepts the following snippet, even though the set subtraction is guaranteed to be a no-op.

    a: Set[str] = set(["hello"])
    b: Set[bytes] = set([b"world"])
    b -= a

Would it make sense to require Set[T] for both arguments to a difference operation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    stubs: false negativeType checkers do not report an error, but should

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions