G_COPY(g, x, g->g); return (ge_pywrap(me, x));
}
+static long ge_pyhash(PyObject *me)
+{
+ buf b;
+ size_t sz = GE_G(me)->noctets + 4;
+ uint32 h = 0xf672c776 + GE_G(me)->ops->ty;
+ octet *p = xmalloc(sz);
+ buf_init(&b, p, sz);
+ G_TOBUF(GE_G(me), &b, GE_X(me));
+ assert(BOK(&b));
+ h = unihash_hash(&unihash_global, h, BBASE(&b), BLEN(&b));
+ xfree(p);
+ return (h % LONG_MAX);
+}
+
static PyObject *gget_r(PyObject *me, void *hunoz)
{ return (mp_pywrap(MP_COPY(GROUP_G(me)->r))); }
&ge_pynumber, /* @tp_as_number@ */
0, /* @tp_as_sequence@ */
0, /* @tp_as_mapping@ */
- 0, /* @tp_hash@ */
+ ge_pyhash, /* @tp_hash@ */
0, /* @tp_call@ */
ge_pystr, /* @tp_str@ */
0, /* @tp_getattro@ */