I'm guessing that this won't fly with upstream ;-)

Is it really faster? A new __unary_div__ method everywhere? Is it really 
faster than special-casing the 1/x case in __div__?

Also, /x/ is a regular expression in JS. If Python ever wanted to support 
that syntax then this would be stepping on the toes of unary divison 
operator. 



On Thursday, June 2, 2016 at 2:01:16 PM UTC+2, Jeroen Demeyer wrote:
>
> 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