<div dir="ltr">Noob question here.<div><br></div><div>Is there any guidance on how to implement __hash__ functions for custom classes. Should they be generated automatically if there is a qHash function?<div><br></div><div>I am trying specifically to debug this issue: <a href="https://github.com/qgis/QGIS/issues/29225">https://github.com/qgis/QGIS/issues/29225</a>, which is caused by the QgsActionScope class not having a hash function. There is an __eq__ function but no __hash__ function.</div><div><br></div><div>Code is at <a href="https://github.com/qgis/QGIS/blob/master/src/core/qgsactionscope.cpp">https://github.com/qgis/QGIS/blob/master/src/core/qgsactionscope.cpp</a>, <a href="https://github.com/qgis/QGIS/blob/master/src/core/qgsactionscope.h">https://github.com/qgis/QGIS/blob/master/src/core/qgsactionscope.h</a> and <a href="https://github.com/qgis/QGIS/blob/master/python/core/auto_generated/qgsactionscope.sip.in">https://github.com/qgis/QGIS/blob/master/python/core/auto_generated/qgsactionscope.sip.in</a>.</div><div><br></div><div>I have tried implementing a special-method in the <a href="http://sip.in">sip.in</a> file but can't seem to get the syntax right, and I am unsure whether this is necessary or not.</div><div><br></div><div>Thanks</div><div><br></div><div>Stephen</div></div></div>