<p>I find it annoying that I can't clear a list. In this example:</p>

<pre><code>a = []
a.append(1)
a.append(2)

a = []
</code></pre>

<p>The second time I initialize a to a blank list, it creates a new instance of a list, which is in a different place in memory, so I can't use it to reference the first, not to mention it's inefficient.</p>

<p>The only way I can see of retaining the same pointer is doing something like the following:</p>

<pre><code>for i in range(len(a)):
    a.pop()
</code></pre>

<p>This seems pretty long-winded though, is there a better way of solving this?</p>

You are looking for:
```
```
del L[:]
```
```