KEMBAR78
--strict-boolean allows logical not to be applied to non-booleans · Issue #3185 · python/mypy · GitHub
Skip to content

--strict-boolean allows logical not to be applied to non-booleans #3185

@pkch

Description

@pkch
a: str

if a:  # Condition must be a boolean
    1

if a and True:  # Condition must be a boolean
    1

if not a:  # No error
    1

The third if statement should also get the same error message.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions