def _dotrig(a, b):
 return ((a.func == b.func) and ((a.has(TrigonometricFunction) and b.has(TrigonometricFunction)) or (a.has(HyperbolicFunction) and b.has(HyperbolicFunction))))

def _dotrig ( a , b ) : return ( ( a . func == b . func ) and ( ( a . has ( TrigonometricFunction ) and b . has ( TrigonometricFunction ) ) or ( a . has ( HyperbolicFunction ) and b . has ( HyperbolicFunction ) ) ) )
helper to tell whether a and b have the same sorts of symbols in them -- no need to test hyperbolic patterns against expressions that have no hyperbolics in them .