def test_hash_vs_eq():
 a = (1 + S.Pi)
 ha = hash(a)
 a.is_positive
 assert (a.is_positive is True)
 assert (ha == hash(a))
 b = a.expand(trig=True)
 hb = hash(b)
 assert (a == b)
 assert (ha == hb)

def test_hash_vs_eq ( ) : a = ( 1 + S . Pi ) ha = hash ( a ) a . is_positive assert ( a . is_positive is True ) assert ( ha == hash ( a ) ) b = a . expand ( trig = True ) hb = hash ( b ) assert ( a == b ) assert ( ha == hb )
catch: different hash for equal objects .