title: PyQt - Window().show() fails but var = Window(); var.show() works?
body: <p>Here is some sample code I was messing around with, when I discovered something I simply don't understand.</p>
  
  <p>This code seems to work</p>
  
  <pre><code>from PyQt4 import QtGui, QtCore
  import sys
  
  class Window(QtGui.QWidget):
      def __init__(self):
          pass
  
  ap = QtGui.QApplication(sys.argv)
  var = Window()
  var.show()
  sys.exit(ap.exec_())
  </code></pre>
  
  <p>But this causes the window to appear than disappear in quick succession. (Second bottom line altered)</p>
  
  <pre><code>from PyQt4 import QtGui, QtCore
  import sys
  
  class Window(QtGui.QWidget):
      def __init__(self):
          pass
  
  ap = QtGui.QApplication(sys.argv)
  Window().show()
  sys.exit(ap.exec_())
  </code></pre>
  
  <p>I simply can not understand why. In all my understanding of python and Qt, I can't fathom why the bottom fails. Is it being garbage collected or something?</p>
  
  <p>Thanks!</p>