title: Appending a list inside a function
body: <p>I am still a bit confused about how arguments are passed in python.
  I thought non-primitive types are passed by reference, but why does the following code not print [1] then?</p>
  
  <pre><code>def listTest(L):
      L = L + [1]
  
  
  def main:
      l = []
      listTest(l)
  
      print l #prints []
  </code></pre>
  
  <p>and how could I make it work.
  I guess I need to pass "a pointer to L" by reference</p>