Summary: Python should have a unary division operator (a.k.a. reciprocal), written "/x", analogous to unary subtraction (a.k.a. negation), written "-x". And then "~x" should be what is intended by Python, namely bitwise negation.

Rationale: Mark Bell gave a talk at Sage Days 74 and he mentioned this as a problem. His software (flipper) uses bitwise negation (the ~ operator) a lot and that breaks when using Sage Integers, where ~ means reciprocal.

Given that Python does not have a reciprocal operator, this problem cannot really be fixed. So if we want operators both for bitwise negation and reciprocal, we need to add a new operator to Python.

I have no idea how feasible it is to actually get a new feature accepted by Python, but it makes a lot of sense to me and the numpy people pulled it off for the matrix multiplication @ operator.

Jeroen.

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to