Python: How expensive is to create a small list many times?
<p>I encounter the following small annoying dilemma over and over again in Python:</p>

<p>Option 1:</p>

<p>cleaner but slower(?) if called many times since a_list get re-created for each call of do_something()</p>

<pre><code>def do_something():    
  a_list = ["any", "think", "whatever"]    
  # read something from a_list
</code></pre>

<p>Option 2:</p>

<p>Uglier but more efficient (spare the a_list creation all over again)</p>

<pre><code>a_list = ["any", "think", "whatever"]    
def do_something():    
  # read something from a_list
</code></pre>

<p>What do you think?</p>
