This question is an extension of a previous question (Python: defining my own operators?). I really liked the solution provided there for Infix operators, but for my expressions, I need a way to define custom unary operators in a similar fashion.
Do you have any recommendations? Reusing the existing python operators doesn't help, as I've used them all up. Thank you very much for your help!
The main reason for doing this overloading is the absence of the following unary operators in Python: (Is > 0) (Is >= 0) I need operators to distinguish between these two types of operations and my requirement is to match my interface as closely as possible with the interface provided by a pre-defined language which comes with its own set of operators. I could have chosen to replace the operators with > 0 and >= 0 but this did not go down very well with the user community. Is there a better way to do this?