Named boolean parameter (ARCH2185)
Key python.quality.named-boolean-parameter · Severity info · Category quality
Bare True/False arguments passed positionally hide what they control. Use a keyword argument to make the intent clear.
Incorrect
Section titled “Incorrect”def export(data, compress, encrypt): ...
export(rows, True, False)Correct
Section titled “Correct”def export(data, compress, encrypt): ...
export(rows, compress=True, encrypt=False)Pass boolean flags as keyword arguments, or use an enum.