do not compare to True in a condition


ID: python-best-practices/no-if-true

Language: Python

Severity: Notice

Category: Code Style


Do not use variable == True, just use variable. Comparing against True makes the code more complicated to read.

Non-Compliant Code Examples

if foo == True:  # just used if foo

Compliant Code Examples

if foo:
  print("bar") jetbrains

Seamless integrations. Try Datadog Code Analysis