<div dir="ltr">Is there a table somewhere that indicates how PyQt handles mapping between python types to Qt/C++ types? I can't find one.<div><br></div><div><div>Introspecting a random selection of some python types is extremely informative:</div><div><br></div><div><div><font face="monospace, monospace" color="#674ea7">>>> from PyQt5.QtCore import QVariant</font></div><div><font face="monospace, monospace" color="#674ea7">>>> import datetime</font></div><div><font face="monospace, monospace" color="#674ea7">>>> dt = datetime.datetime(2017,1,1)</font></div><div><div><font color="#674ea7" face="monospace, monospace">>>> for x in ("a", b"b", 1, 1.1, [], [1], (1,), {}, {'a': 1}, {1:2}, None, True, set(), dt): </font></div><div><font color="#674ea7" face="monospace, monospace">... print("%-20r : %s" % (x, QVariant(x).typeName()))</font></div><div><font color="#674ea7" face="monospace, monospace">... </font></div><div><font color="#674ea7" face="monospace, monospace">'a' : QString</font></div><div><font color="#674ea7" face="monospace, monospace">b'b' : PyQt_PyObject</font></div><div><font color="#674ea7" face="monospace, monospace">1 : int</font></div><div><font color="#674ea7" face="monospace, monospace">1.1 : double</font></div><div><font color="#674ea7" face="monospace, monospace">[] : QVariantList</font></div><div><font color="#674ea7" face="monospace, monospace">[1] : QVariantList</font></div><div><font color="#674ea7" face="monospace, monospace">(1,) : PyQt_PyObject</font></div><div><font color="#674ea7" face="monospace, monospace">{} : QVariantMap</font></div><div><font color="#674ea7" face="monospace, monospace">{'a': 1} : QVariantMap</font></div><div><font color="#674ea7" face="monospace, monospace">{1: 2} : PyQt_PyObject</font></div><div><font color="#674ea7" face="monospace, monospace">None : None</font></div><div><font color="#674ea7" face="monospace, monospace">True : bool</font></div><div><font color="#674ea7" face="monospace, monospace">set() : PyQt_PyObject</font></div><div><font color="#674ea7" face="monospace, monospace">datetime.datetime(2017, 1, 1, 0, 0) : PyQt_PyObject</font></div></div></div><div><font face="monospace, monospace"><br></font></div><div>Does that table exist anywhere?</div><div><br></div><div>Also of interest (not a bug report or complaint) is the apparent lack of automatic type conversion for bytes, tuples, and datetimes, as well as the recognition of non-string dict keys.</div><div><br></div><div><br></div>
</div></div>