You can access the operator via .operator()
and do your comparisons that way:
sage: s[0][0].operator()
<function operator.gt>
sage: s[0][1].operator()
<function operator.lt>
sage: s[0][0].operator() == operator.gt
True
sage: s[0][0].operator() == operator.lt
False
To be honest I've fallen back on doing string comparisons in the past when it seemed more convenient (although you have to remember to make sure that >
doesn't trip before >=
.)