How do you pass an arbitrary python object in/out of a QDataStream when you have the SIP API set to version 2 for QVariants?<br><br>>>> import sip<br>>>> sip.setapi('QVariant', 2)<br>>>> from PyQt4 import QtCore<br>
>>> data = QtCore.QByteArray()<br>>>> outstream = QtCore.QDataStream(data, QtCore.QIODevice.WriteOnly)<br>>>> outstream << {'foo':'bar'}<br>Traceback (most recent call last):<br>
File "<stdin>", line 1, in <module><br>TypeError: unsupported operand type(s) for <<: 'QDataStream' and 'dict'<br>>>> outstream << QtCore.QVariant({'foo':'bar'})<br>
Traceback (most recent call last):<br> File "<stdin>", line 1, in <module><br>TypeError: PyQt4.QtCore.QVariant represents a mapped type and cannot be instantiated<br><br>