1 parent c2bb534 commit cbe442bCopy full SHA for cbe442b
python-types.c
@@ -969,6 +969,12 @@ tgl_Peer_repr(tgl_Peer *self)
969
return ret;
970
}
971
972
+int
973
+tgl_Peer_hash(PyObject *self)
974
+{
975
+ return PyObject_Hash(PyObject_GetAttrString(self, "id"));
976
+}
977
+
978
PyObject *
979
tgl_Peer_RichCompare(PyObject *self, PyObject *other, int cmp)
980
{
@@ -1016,7 +1022,7 @@ PyTypeObject tgl_PeerType = {
1016
1022
0, /* tp_as_number */
1017
1023
0, /* tp_as_sequence */
1018
1024
0, /* tp_as_mapping */
1019
- 0, /* tp_hash */
1025
+ (hashfunc)tgl_Peer_hash, /* tp_hash */
1020
1026
0, /* tp_call */
1021
1027
0, /* tp_str */
1028
0, /* tp_getattro */
0 commit comments