I think you could use `reload()` instead of messing with sys.modules directly.
Another option is to pack all of the definitions in _qt.py inside a function so you can generate multiple instances of those classes. That would probably be a bit more pythonic:

```
import PyQt4.QtCore, PyQt4.QtGui, PyQt4.QtOpenGL
from . import _qt
qt_classes = _qt.make_classes(PyQt4)
```

.. but I don't really see anything wrong with what you have written, aside from it being confusing.