> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Simplify Boolean Comparison

#### Sourcery refactoring id: `simplify-boolean-comparison`

#### Description:

Removes unnecessarily verbose boolean comparisons

#### Before:

```python
need_hat = not is_raining
if need_hat == True:
    put_on_hat()
```

#### After:

```python
need_hat = not is_raining
if need_hat:
    put_on_hat()
```

#### Explanation:

It is unnecessary to compare boolean values to `True` or `False` in the test of
an `if` condition. Removing these unnecessary checks makes the code slightly
shorter and easier to parse.
