-
-
Notifications
You must be signed in to change notification settings - Fork 641
Open
Description
Equal objects must have the same hash if they are hashable (http://docs.python.org/2/reference/datamodel.html#object.__hash__):
sage: my_func = function('func',nargs=1)
sage: f = my_func(0)
sage: bool(f == f.simplify())
True
sage: hash(f) == hash(f.simplify())
False
As reported on http://ask.sagemath.org/question/2587/simplify-shenanigans, hash lookup errors then leads to undesirable behavior:
sage: ex = my_func(0) + my_func(1)
sage: ex.subs(my_func(0)==1)
func(1) + 1
sage: ex.simplify().subs(my_func(0)==1)
func(0) + func(1)
Component: symbolics
Issue created by migration from https://trac.sagemath.org/ticket/14608