in src/latex2sympy2_extended/latex2sympy2.py [0:0]
def is_expr_of_only_symbols(expr):
if hasattr(expr, 'is_Symbol') and expr.is_Symbol:
return True
# To allow A/S
if hasattr(expr, 'is_Pow') and expr.is_Pow and expr.args[1] == -1 and (
hasattr(expr.args[0], 'is_Symbol') and expr.args[0].is_Symbol
or hasattr(expr.args[0], 'args') and all(is_expr_of_only_symbols(arg) for arg in expr.args[0].args)
):
return True
if hasattr(expr, 'args') and len(expr.args) > 0:
return all(is_expr_of_only_symbols(arg) for arg in expr.args)
return False