Skip to content

boolean-positional-value-in-call (FBT003)#

Derived from the flake8-boolean-trap linter.

What it does#

Checks for boolean positional arguments in function calls.

Why is this bad?#

Calling a function with boolean positional arguments is confusing as the meaning of the boolean value is not clear to the caller, and to future readers of the code.

Example#

def func(flag: bool) -> None:
    ...


func(True)

Use instead:

def func(flag: bool) -> None:
    ...


func(flag=True)

References#