diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2013-07-05 05:35:22 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2013-07-05 05:35:22 +0000 |
| commit | d7e42f00c52c7e92638d129cb79ba62631dd64a8 (patch) | |
| tree | 40f9da9835172c325c6a232224dbed5d61263acd /src/runtime/python | |
| parent | 8f2032a07de4e6d50c8f853a5612e6a2f24d9368 (diff) | |
the hash function for pgf.Expr is now really added
Diffstat (limited to 'src/runtime/python')
| -rw-r--r-- | src/runtime/python/pypgf.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c index a327b8e77..094744885 100644 --- a/src/runtime/python/pypgf.c +++ b/src/runtime/python/pypgf.c @@ -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*/ |
