Opened 7 years ago

Closed 7 years ago

#20504 closed enhancement (fixed)

python3 print inside src/sage/all.py

Reported by: Frédéric Chapoton Owned by:
Priority: major Milestone: sage-7.2
Component: python3 Keywords: python3
Cc: Jeroen Demeyer, Erik Bray, Travis Scrimshaw Merged in:
Authors: Frédéric Chapoton Reviewers: Jeroen Demeyer, Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 71b5afa (Commits, GitHub, GitLab) Commit: 71b5afa881b48221e41f5bf0e51ea0a7f6a7336c
Dependencies: Stopgaps:

Status badges

Description

let us try to have the master file src/sage/all.py python3 compatible

Change History (13)

comment:1 Changed 7 years ago by Frédéric Chapoton

Branch: public/20504
Cc: Jeroen Demeyer Erik Bray added
Commit: 28c61419767a069a371a3ccf46b66c24c7e53653
Status: newneeds_review

New commits:

28c6141trac 20504 python3 print in sage/all.py

comment:2 Changed 7 years ago by Jeroen Demeyer

Regarding

print("Sage requires Python 2.5 or newer", file=sys.stderr)

I'm pretty sure that Sage requires Python 2.7. But honestly, I would just remove that check, I don't see the point of it.

Another point: if you're making changes to the division anyway, you might as well use // and add from __future__ import division.

comment:3 in reply to:  2 Changed 7 years ago by François Bissey

Replying to jdemeyer:

Regarding

print("Sage requires Python 2.5 or newer", file=sys.stderr)

I'm pretty sure that Sage requires Python 2.7. But honestly, I would just remove that check, I don't see the point of it.

+1, I am fairly sure that when we upgraded to python 2.7 in sage 5.0 a few changes where incompatible with earlier python, and it just pilled on from there.

comment:4 Changed 7 years ago by git

Commit: 28c61419767a069a371a3ccf46b66c24c7e5365302985339a6ba924372286bd250d35beacc239748

Branch pushed to git repo; I updated commit sha1. New commits:

0298533remove the check for python version > 2.5

comment:5 Changed 7 years ago by Frédéric Chapoton

hmm. It seems that importing print_function here gives us a lot of places where print must be corrected. Maybe this should be undone and redone in another ticket ?

comment:6 Changed 7 years ago by git

Commit: 02985339a6ba924372286bd250d35beacc23974871b5afa881b48221e41f5bf0e51ea0a7f6a7336c

Branch pushed to git repo; I updated commit sha1. New commits:

71b5afaremove the future imports here (that would trigger many doctests failures)

comment:7 Changed 7 years ago by Frédéric Chapoton

the patchbot is green, ping ?

comment:8 Changed 7 years ago by Vincent Delecroix

Component: PLEASE CHANGEpython3

comment:9 Changed 7 years ago by Frédéric Chapoton

Cc: Travis Scrimshaw added

ping ? could someone please approve that simple ticket, so that one can move forward ?

comment:10 Changed 7 years ago by Travis Scrimshaw

Is comment:5 similar to why you did not add from __future__ import division?

comment:11 Changed 7 years ago by Frédéric Chapoton

I have not tried, but I would say yes. Probably inserting any future import here would trigger it for all files. This will be good, once all tests pass, to keep things ok by just inserting one import here.

comment:12 Changed 7 years ago by Travis Scrimshaw

Reviewers: Jeroen Demeyer, Travis Scrimshaw
Status: needs_reviewpositive_review

comment:13 Changed 7 years ago by Volker Braun

Branch: public/2050471b5afa881b48221e41f5bf0e51ea0a7f6a7336c
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.