What is the best way to get a string version of a builtin function in Python?
i.e.
>>> import operator
>>> gt = operator.gt
>>> gt
<function _operator.gt>
>>> str(gt)
'<built-in function gt>'
What is the best way to get >
back from gt
? (Note: I only actually need this for these operators: >
, <
, >=
, <=
, ==
and !=
).