[PyQt] QTreeWidgetItem is not hashable in Py3

Phil Thompson phil at riverbankcomputing.com
Wed Mar 29 16:41:52 BST 2017


On 28 Mar 2017, at 5:31 pm, Sambhav Kothari <sambhavs.email at gmail.com> wrote:
> 
> Hi,
> QTreeWidgetItem seems to be no longer hashable in py3.
> 
> I am using pyqt5.8.1 and py3.6. Is this a known issue?

Python considers a type to be unhashable if it has a comparison operator (which QTreeWidgetItem does).

Should should be able to implement __hash__() in a sub-class that does what you want.

Phil



More information about the PyQt mailing list