Skip to content

--strict-equality should be disabled in functions with constrained type variables #6735

Closed
@ilevkivskyi

Description

@ilevkivskyi

Consider this valid code:

def foo(x: AnyStr) -> AnyStr:
    if x == '':  # False positive here
        ...
    return x

With --strict-equality this produces a "Non-overlapping equality check ...", because the function body is checked multiple times with both values of AnyStr.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions