Hi!

Let R be a ring that is an F-vector space, for some field F.
Let x,y be elements of R and c be an element of F.

If I understand correctly, in order to implement x/y, one should provide
a single underscore method x._div_. But what should one provide for x/c?
It seems that the default behaviour is to replace x/c by x*(~c), but
for efficiency I don't want that c is inverted in F before letting it
act on x.

Moreover, in my use case, R is not an integral domain (thus, has no fraction
field), and actually I don't want division in R at all. So, what do I
need to do in order to make x/y NOT work (and fail with a TypeError)?

In the above situation, is it recommended to override double underscore
__div__? Then what about Py3? Would it then be needed to override
__div__, __truediv__ and __floordiv__?

Best regards,
Simon

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/qm4nsn%245e4%241%40blaine.gmane.org.

Reply via email to