# Revision history [back]

### Human-readable form of operator() of an expression?

Consider the code below

sage: x,y=var('x y')
sage: (x+y).operator()


The output in the last line is a bit lengthy, and makes it hard for me to automatically test what kind of expression I have (e.g. determining if the expression is a sum or a product of operands). I would like to write code like this

if someExpression.operator() == plus:
print("this is a sum")
elif someExpression.operator() == multiply:
print("this is a product")
else:
print("this is something else")


How should I modify the if-else loop above to make it actually work?

### Human-readable form of operator() of an expression?

Consider the code below

sage: x,y=var('x y')
sage: (x+y).operator()

if someExpression.operator() == plus: