#20694 closed enhancement (fixed)
use six to import builtins
Reported by:  Frédéric Chapoton  Owned by:  

Priority:  major  Milestone:  sage7.3 
Component:  python3  Keywords:  days74 
Cc:  Travis Scrimshaw, Jori Mäntysalo, Jeroen Demeyer  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  e87c370 (Commits, GitHub, GitLab)  Commit:  
Dependencies:  Stopgaps: 
Description (last modified by )
change import __builtin__
to from six.moves import builtins
as a small step towards python3
Change History (15)
comment:1 Changed 6 years ago by
Branch:  → public/20694 

Cc:  Travis Scrimshaw Jori Mäntysalo Jeroen Demeyer added 
Commit:  → 22c79f1496229d4a0318bfe3b1f9818d06cff720 
Status:  new → needs_review 
comment:2 Changed 6 years ago by
Description:  modified (diff) 

comment:3 Changed 6 years ago by
Commit:  22c79f1496229d4a0318bfe3b1f9818d06cff720 → d5ae950877412a3d87d96498c2116ad229dc4f75 

Branch pushed to git repo; I updated commit sha1. New commits:
d5ae950  trac 20694 undo change in pyx file

comment:4 Changed 6 years ago by
Status:  needs_review → positive_review 

comment:5 Changed 6 years ago by
Status:  positive_review → needs_work 

hum, wait a moment, it seems that the tests do not pass
comment:6 Changed 6 years ago by
Tried to investigate, but so far got no idea why this can fail.
This import works in a python session in sageshell. And in sage itself too. And there are other places in the code of sage where six.moves is already used.
comment:7 Changed 6 years ago by
Commit:  d5ae950877412a3d87d96498c2116ad229dc4f75 → 3b48926336a4be734ae336e334e2ffdf49f41718 

comment:8 Changed 6 years ago by
Commit:  3b48926336a4be734ae336e334e2ffdf49f41718 → c9695ddc5d478e4eaf7d257cac51f49565c9b5d4 

Branch pushed to git repo; I updated commit sha1. New commits:
c9695dd  trac 20694 wrong import of builtins

comment:9 Changed 6 years ago by
Status:  needs_work → needs_review 

comment:10 Changed 6 years ago by
Status:  needs_review → needs_work 

still not working. This ticket seems to be much more tricky than expected.
comment:11 Changed 6 years ago by
Commit:  c9695ddc5d478e4eaf7d257cac51f49565c9b5d4 → e87c370b3e2429f166473ac5835e7c0e9cfe9d1d 

Branch pushed to git repo; I updated commit sha1. New commits:
e87c370  trac 20694 fixing the problems by adding from future import

comment:12 Changed 6 years ago by
Status:  needs_work → needs_review 

ok, this trouble was all caused by the existence of a module named "six" in sage/misc.
Should be good now.
comment:13 Changed 6 years ago by
Reviewers:  → Vincent Delecroix 

Status:  needs_review → positive_review 
comment:14 Changed 6 years ago by
Branch:  public/20694 → e87c370b3e2429f166473ac5835e7c0e9cfe9d1d 

Resolution:  → fixed 
Status:  positive_review → closed 
comment:15 Changed 6 years ago by
Commit:  e87c370b3e2429f166473ac5835e7c0e9cfe9d1d 

Keywords:  days74 added 
New commits:
trac 20694 using six.moves import builtins