But you *have* to. You cannot use PyQt4 without globally committing to a SIP api -- as soon as you import it, it gets committed (globally and forever). So there's no way to avoid making a commitment assuming any part of the IPython code needs to work with PyQt4.

One way for user code to deal with this is to import Qt on their own. This PR knows if this happens (by checking sys.modules), and qt_for_kernel will use this imported version if it finds it. qt_for_kernel.py will still be compatible with any API that user code wants -- it just needs enough information to know which API to use (either from the QT_API variable, or an existing import).