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

# Tuple-Literal

#### Sourcery rule id: `tuple-literal`

#### Description

Replace `tuple()` with `()`


#### Before

```python
x = tuple()
```

#### After

```python
x = ()
```



#### Explanation

The most concise and Pythonic way to create an empty tuple is to use the `()`
literal.

This fits in with the way we create tuples with items, saving a bit of
mental energy that might be taken up with thinking about two different ways of
creating tuples:

```python
x = ("first", "second")
```

Doing things this way has the added advantage of being a nice little performance
improvement. Here are the timings before and after the change:

```
$ python3 -m timeit "tuple()"
10000000 loops, best of 5: 22.6 nsec per loop
```

```
$ python3 -m timeit "()"
50000000 loops, best of 5: 5.46 nsec per loop
```
