title: Altering a list using append during a list comprehension
body: <p><strong>Caveat: this is a straight up question for code-golfing, so I know what I'm asking is bad practise in production</strong></p>
  
  <p>I'm trying to alter an array during a list comprehension, but for some reason it is hanging and I don't know why or how to fix this.</p>
  
  <p>I'm dealing with a list of lists of indeterminite depth and need to condense them to a flat list - <a href="https://codegolf.stackexchange.com/questions/15783/check-wheter-there-are-more-even-then-odd-numbers-on-any-given-nested-list">for those curious its this question</a>. But at this stage, lets just say I need a flat list of all the elements in the list, and 0 if it is a list.</p>
  
  <p>The normal method is to iterate through the list and if its a list add it to the end, like so:</p>
  
  <pre><code>for o in x:
   if type(o)==type([]):x+=o
   else:i+=o
  print i
  </code></pre>
  
  <p>I'm trying to shorten this using list comprehension, like so.</p>
  
  <pre><code>print sum([
   [o,x.append(o) or 0][type(o)==type([])]
   for o in x
  ]))
  </code></pre>
  
  <p>Now, I know <code>List.append</code> returns None, so to ensure that I get a numeric value, lazy evaluation says I can do <code>x.append(o) or 0</code>, and since <code>None</code> is "falsy" it will evaulate the second part and the value is <code>0</code>.</p>
  
  <p>But it doesn't. If I put <code>x.append()</code> into the list comprehension over <code>x</code>, it doesn't break or error, or return an iteration error, it just freezes. <strong>Why does <code>append</code> freeze during the list comprehension, but the <code>for</code> loop above works fine?</strong></p>
  
  <p><strong>edit: To keep this question from being deleted</strong>, I'm not looking for golfing tips (they are very educational though), I was looking for an answer as to why the code wasn't working as I had written it.</p>