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

# Skip Sorted List Construction

#### Sourcery refactoring id: `skip-sorted-list-construction`

#### Description:

Removes an unnecessary intermediate construction call for a sorted list, in
favour of the `sorted` builtin.

#### Before:

```python
pies = list(pie_generator())
pies.sort()
```

#### After:

```python
pies = sorted(pie_generator())
```

#### Explanation:

It's unnecessary to construct an intermediate list when sorting a generator, as
the `sorted` builtin returns a list.
