title: Connecting slots and signals in PyQt4 in a loop
body: <p>Im trying to build a calculator with PyQt4 and connecting the 'clicked()' signals from the buttons doesn't work as expected.
  Im creating my buttons for the numbers inside a for loop where i try to connect them afterwards.</p>
  
  <pre><code>def __init__(self):
      for i in range(0,10):
          self._numberButtons += [QPushButton(str(i), self)]
          self.connect(self._numberButtons[i], SIGNAL('clicked()'), lambda : self._number(i))
  
  def _number(self, x):
      print(x)
  </code></pre>
  
  <p>When I click on the buttons all of them print out '9'.
  Why is that so and how can i fix this?</p>