Opened 6 years ago
Closed 6 years ago
#20548 closed enhancement (fixed)
py3 print in numerical folder
Reported by: | chapoton | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-7.2 |
Component: | python3 | Keywords: | |
Cc: | Merged in: | ||
Authors: | Frédéric Chapoton, Matthias Koeppe | Reviewers: | Frédéric Chapoton, Matthias Koeppe |
Report Upstream: | N/A | Work issues: | |
Branch: | 4142421 (Commits, GitHub, GitLab) | Commit: | 41424218fbfdf598f3c772aa52300f4ae4c3d6f4 |
Dependencies: | Stopgaps: |
Description
another small step, trying to turn print to python3 behaviour
Change History (23)
comment:1 Changed 6 years ago by
- Branch set to public/20548
- Commit set to 5922fbaf3f43b362482fb0e7c18129de0fe1b399
- Status changed from new to needs_review
comment:2 Changed 6 years ago by
- Commit changed from 5922fbaf3f43b362482fb0e7c18129de0fe1b399 to cb257a07c32a2d9a6adb053e3662d0e0ee029b44
Branch pushed to git repo; I updated commit sha1. New commits:
cb257a0 | python3 print in numerical, details and fixing
|
comment:3 Changed 6 years ago by
- Status changed from needs_review to needs_info
Is this valid Python 3?
comment:4 Changed 6 years ago by
- Status changed from needs_info to needs_work
Well, it's technically valid but it doesn't do what you think it does:
Python 3.3.2 (default, Dec 7 2013, 12:59:33) [GCC 4.6.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print <built-in function print>
comment:5 Changed 6 years ago by
One more detail, since you're changing the code anyway. Change this
if b.obj_constant_term > self._backend.zero(): print("+ {}".format(b.obj_constant_term)) elif b.obj_constant_term < self._backend.zero(): print("- {}".format(-b.obj_constant_term))
to
if b.obj_constant_term > self._backend.zero(): print("+ {}".format(b.obj_constant_term)) elif b.obj_constant_term < self._backend.zero(): print("- {}".format(-b.obj_constant_term))
which is much more readable
comment:6 Changed 6 years ago by
Same for
if d > self._backend.zero(): print("+ {} ".format(d)) elif d < self._backend.zero(): print("- {} ".format(-d))
comment:7 Changed 6 years ago by
- Commit changed from cb257a07c32a2d9a6adb053e3662d0e0ee029b44 to ca3d65330731d5707fc27bf7036f02e6e216e401
Branch pushed to git repo; I updated commit sha1. New commits:
ca3d653 | python3 print in numerical, fine tuning
|
comment:9 Changed 6 years ago by
needs merge or rebase
comment:10 Changed 6 years ago by
- Commit changed from ca3d65330731d5707fc27bf7036f02e6e216e401 to 46fe07f0bccb30b6728ce089a767cfdbfc51d515
Branch pushed to git repo; I updated commit sha1. New commits:
46fe07f | Merge branch 'public/20548' into 7.2.rc1
|
comment:11 Changed 6 years ago by
You missed several backends
comment:12 Changed 6 years ago by
The aim is to have the doctests pass when adding a global future print
import in sage/all.py.
For that, all the backends where something was needed were modified.
You can check this by adding from __future__ import print_function
in src/sage/all.py
on top of this branch and running all the tests in the numerical folder.
If you want to take the opportunity to convert everything else to python3 print style in the numerical folder, please do.
comment:13 Changed 6 years ago by
ping ?
comment:14 Changed 6 years ago by
- Commit changed from 46fe07f0bccb30b6728ce089a767cfdbfc51d515 to 41424218fbfdf598f3c772aa52300f4ae4c3d6f4
Branch pushed to git repo; I updated commit sha1. New commits:
4142421 | python3 print in remaining mip backends
|
comment:15 Changed 6 years ago by
Yes, as I said, you missed some backends. I've done the remaining ones.
comment:16 follow-up: ↓ 17 Changed 6 years ago by
ok, I had forgotten about the optional backends, indeed.
Why did you change two print
to sys.stdout.write
?
comment:17 in reply to: ↑ 16 Changed 6 years ago by
Replying to chapoton:
Why did you change two
sys.stdout.write
?
These are print-without-newlines.
comment:18 Changed 6 years ago by
ok, then I am happy with your commit. Are you ok with mines ?
comment:19 Changed 6 years ago by
yes, looking good
comment:20 Changed 6 years ago by
So, can I set to positive review ?
comment:21 Changed 6 years ago by
sure
comment:22 Changed 6 years ago by
- Reviewers set to Frédéric Chapoton, Matthias Koeppe
- Status changed from needs_review to positive_review
done, thanks
comment:23 Changed 6 years ago by
- Branch changed from public/20548 to 41424218fbfdf598f3c772aa52300f4ae4c3d6f4
- Resolution set to fixed
- Status changed from positive_review to closed
New commits:
python3 print in numerical folder