assign multiple instances of a class to variables
<p>Python. I need to assign multiple class instances to number of variables. First i tried this:</p>

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

<p>but they all refer to the same object, which is not what I need. This works better:</p>

<pre><code>(a, b, c) = [[] for i in range(3)]
</code></pre>

<p>but it seems a bit too verbose. Is there a shorter way to do this?</p>

<p>UPDATE: OK, so this is not really Pythonic to cram everything into one line, question resolved.</p>

<p>But if this worked it'd be really cool:</p>

<pre><code>a,b,c = []*3
</code></pre>

<p>And this line creates three references to the same object:</p>

<pre><code>a,b,c = [[]] * 3
</code></pre>

<p>Oh well...</p>
