title: List comprehension rebinds names even after scope of comprehension. Is this right?
body: <p>Comprehensions are having some unexpected interactions with scoping. Is this the expected behavior?</p>
  
  <p>I've got a method:</p>
  
  <pre><code>def leave_room(self, uid):
    u = self.user_by_id(uid)
    r = self.rooms[u.rid]
  
    other_uids = [ouid for ouid in r.users_by_id.keys() if ouid != u.uid]
    other_us = [self.user_by_id(uid) for uid in other_uids]
  
    r.remove_user(uid) # OOPS! uid has been re-bound by the list comprehension above
  
    # Interestingly, it's rebound to the last uid in the list, so the error only shows
    # up when len &gt; 1
  </code></pre>
  
  <p>At the risk of whining, this is a brutal source of errors. As I write new code, I just occasionally find very weird errors due to rebinding -- even now that I know it's a problem. I need to make a rule like "always preface temp vars in list comprehensions with underscore", but even that's not fool-proof.</p>
  
  <p>The fact that there's this random time-bomb waiting kind of negates all the nice "ease of use" of list comprehensions.</p>