title: Python: What does the use of [] mean here?
body: <p>What is the difference in these two statements in python? </p>
  
  <pre><code>var = foo.bar
  </code></pre>
  
  <p>and</p>
  
  <pre><code>var = [foo.bar]
  </code></pre>
  
  <p>I think it is making var into a list containing foo.bar but I am unsure. Also if this is the behavior and foo.bar is already a list what do you get in each case?</p>
  
  <p>For example: if foo.bar = [1, 2] would I get this?</p>
  
  <pre><code>var = foo.bar #[1, 2]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>var = [foo.bar] #[[1,2]] where [1,2] is the first element in a multidimensional list
  </code></pre>