1
0
forked from GitHub/gf-core

the hash function for pgf.Expr is now really added

This commit is contained in:
kr.angelov
2013-07-05 05:35:22 +00:00
parent 8f2032a07d
commit d7e42f00c5

View File

@@ -150,6 +150,12 @@ Expr_richcompare(ExprObject *e1, ExprObject *e2, int op)
}
}
static long
Expr_hash(ExprObject *e)
{
return (long) pgf_expr_hash(0, e->expr);
}
static PyMethodDef Expr_methods[] = {
{"unpack", (PyCFunction)Expr_unpack, METH_VARARGS,
"Decomposes an expression into its components"
@@ -200,7 +206,7 @@ static PyTypeObject pgf_ExprType = {
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash */
(hashfunc) Expr_hash, /*tp_hash */
0, /*tp_call*/
(reprfunc) Expr_repr, /*tp_str*/
(getattrofunc) Expr_getattro,/*tp_getattro*/