#18578: Python 3 preparation: Special function __div__() is used no more in Py3
---------------------------+----------------------------
Reporter: wluebbe | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.8
Component: misc | Keywords: python3
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
---------------------------+----------------------------
There (among others) the three special functions {{{__div__()}}},
{{{__truediv__()}}} and {{{__floordiv__()}}}.
They are invoked by the division operators {{{/}}} and {{{//}}}:
* In Py2: {{{__div__()}}} and {{{__floordiv__()}}} are called.
* In Py2 (when {{{from __future__ import division}}} is in effect):
{{{__truediv__()}}} and {{{__floordiv__()}}} are called.
* In Py3: {{{__truediv__()}}} and {{{__floordiv__()}}} are called.
So in the last two cases {{{__div__()}}} is not called for {{{/}}} but
{{{__truediv__()}}}.
If {{{__truediv__()}}} is not available an exception is thrown.
Therefor classes defining {{{__div__()}}} must be checked that they also
work in the last two cases! The related special function {{{__idiv__()}}}
is effected too.
The ticket is tracked as a dependency of #15995.
--
Ticket URL: <http://trac.sagemath.org/ticket/18578>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.