def singularities(expr, sym):
 if (not expr.is_rational_function(sym)):
  raise NotImplementedError('Algorithms finding singularities for non rational functions are not yet implemented')
 else:
  return solveset(simplify((1 / expr)), sym)

def singularities ( expr , sym ) : if ( not expr . is_rational_function ( sym ) ) : raise NotImplementedError ( 'Algorithms finding singularities for non rational functions are not yet implemented' ) else : return solveset ( simplify ( ( 1 / expr ) ) , sym )
finds singularities for a function .