Skip to content

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

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions