New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
py3: operator has no longer div and idiv methods #22875
Comments
This comment has been minimized.
This comment has been minimized.
Commit: |
Branch: u/chapoton/22875 |
New commits:
|
Author: Frédéric Chapoton |
Replying to @fchapoton:
You don't have to. You could keep using
Please revert the change to lazy import, it conflicts with #22755. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Dependencies: #22755 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:7
maybe this does not really depend on #22755 ? |
Changed dependencies from #22755 to none |
comment:8
Replying to @fchapoton:
No, it doesn't. |
comment:9
thanks. So let me put this into "needs_review" and hope that a patchbot will run on it. |
comment:10
well, patchbot is morally green. Please review |
comment:11
I'm confused by the Python 2-to-3 conversion here. When I look at documentation for the Python 2
Does this mean that we need Regarding the change cdef long j
cdef long prec
- if op not in (operator.add, operator.sub, operator.mul, operator.div):
+ if op not in (operator.add, operator.sub, operator.mul, operator.truediv):
raise ValueError("op must be operator.OP where OP=add, sub, mul or div")
if not isinstance(p2, Polynomial): in sage/rings/polynomial/polynomial_element.pyx, the docstring needs to be changed, too:
Also the string in the error message: "op must be ... or truediv". |
comment:13
The strategy here is very simple : get rid of any use of div everywhere, and use truediv instead. This works smoothly, as the bot has been green already. This does not fix completely the division issue, as we may have later to add the future import in some files that use /. This has already been partially done. |
comment:14
green bot ! |
comment:15
Replying to @jhpalmieri:
You need to interpret it "Return |
comment:16
I don't really understand the symbolic stuff, so I cannot really check it well. On the other hard, there is probably no reason for symbolics to treat "div" differently from "truediv". |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:20
Working on getting a working |
comment:21
Cool ! This is what I was trying to do, see the branch public/python3-experiment-v1 for nearly the latest stage that I reached. |
comment:22
I'll push a reviewer commit, which is easier than telling you what to fix. |
comment:23
Replying to @fchapoton:
Ah, I wasn't sure what your latest branch was. I was confused because there weren't tickets for some things yet, but I was pretty sure you had something closer to working somewhere... |
comment:24
I went slightly further, in particular by adding |
Changed branch from u/chapoton/22875 to u/jdemeyer/22875 |
Changed author from Frédéric Chapoton to Frédéric Chapoton, Jeroen Demeyer |
comment:26
These are my proposed fixes. Essentially, all fixes are to keep support for Python 2 division where applicable. I reintroduced some instances of For me, this ticket can get positive review if you agree with my commit. New commits:
|
comment:27
one failing doctest ('div' gets duplicated in this list, somehow) |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:29
Fixed. |
comment:30
Looks good to me. I am ready to set to positive. Thanks a lot for finishing the job ! But maybe one should have more patchbot reports, including some with more optional packages installed, just to be sure that nothing serious breaks ? |
Reviewer: Frédéric Chapoton, Jeroen Demeyer |
comment:31
ok, there are two green bots. I am setting to positive. |
Changed branch from u/jdemeyer/22875 to |
related to #15995
this means that we need to change the coercion framework, and in particular
CC: @jdemeyer @tscrim @jhpalmieri @embray
Component: python3
Author: Frédéric Chapoton, Jeroen Demeyer
Branch/Commit:
9f1c2e6
Reviewer: Frédéric Chapoton, Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/22875
The text was updated successfully, but these errors were encountered: