> ## 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.

# Remove Redundant Pass

#### Sourcery refactoring id: `remove-redundant-pass`

#### Description:

Removes unnecessary `pass` statements

#### Before:

```python
if a:
    x()
else:
    pass
```

```python
do_something()
pass
```

#### After:

```python
if a:
    x()
```

```python
do_something()
```

#### Explanation:

A `pass` statement is unnecessary if a block has other statements in it, and an
`else` which only contains `pass` can be safely removed. Making these changes
shortens the code, and the reader doesn't have to consider and deal with the
unnecessary `pass` statements.
