Opened 5 years ago
Last modified 4 months ago
#16079 needs_work enhancement
Python 3 preparation: In Py3 there is only one string type "str" (which is unicode!) — at Version 18
Reported by:  wluebbe  Owned by:  

Priority:  major  Milestone:  sage8.0 
Component:  python3  Keywords:  python3, unicode 
Cc:  tscrim, jmantysalo, jdemeyer  Merged in:  
Authors:  André Apitzsch  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  public/16079 (Commits)  Commit:  d1b11bf468779fde89856e0e565bfe0e4c1f3cc1 
Dependencies:  Stopgaps: 
Description (last modified by )
This is often considered the most important change in Py3. The approach still has to be determined!
The tool 2to3 simple changes unicode
to str
and removes the uprefix from string literals (u'xxx'
to 'xxx'
).
But the code has to depend on the Python version!
This ticket is tracked as a dependency of metaticket #16052.
Change History (18)
comment:1 Changed 5 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:2 Changed 5 years ago by
 Milestone changed from sage6.3 to sage6.4
comment:3 Changed 4 years ago by
 Branch set to u/aapitzsch/ticket/16079
 Commit set to a4e66492ce638d515a42f9da9d2a68aae3b382bc
 Status changed from new to needs_review
comment:4 Changed 4 years ago by
 Status changed from needs_review to needs_work
this breaks the doc building, see patchbot report
comment:5 Changed 3 years ago by
 Component changed from distribution to python3
 Milestone changed from sage6.4 to sage7.2
comment:6 Changed 3 years ago by
 Branch changed from u/aapitzsch/ticket/16079 to public/16079
 Commit changed from a4e66492ce638d515a42f9da9d2a68aae3b382bc to e1344bd7a167c30e6e7d3659eff70ebbc023a4b6
New commits:
e1344bd  Merge branch 'u/aapitzsch/ticket/16079' into 7.2.rc2

comment:7 Changed 3 years ago by
 Commit changed from e1344bd7a167c30e6e7d3659eff70ebbc023a4b6 to e6b9d7cedb213a34f5aa4b6f8fd7a3166fc2a9cb
comment:8 Changed 3 years ago by
 Commit changed from e6b9d7cedb213a34f5aa4b6f8fd7a3166fc2a9cb to a59b4a17bc353c842050a1fe217fae6035de6648
comment:9 Changed 3 years ago by
 Commit changed from a59b4a17bc353c842050a1fe217fae6035de6648 to 687e6f040c64e23dc42ded6d11b485bdc520723f
Branch pushed to git repo; I updated commit sha1. New commits:
687e6f0  trac 16079 using six.tex_type in docbuilding

comment:10 Changed 3 years ago by
 Milestone changed from sage7.2 to sage7.4
comment:11 Changed 3 years ago by
 Cc tscrim jmantysalo jdemeyer added
 Status changed from needs_work to needs_review
bot is green
maybe this is only a good step, to be done in another ticket ?
comment:12 Changed 3 years ago by
I don't believe that src/sage/misc/lazy_string.pyx
needs any changes at all. There is nothing wrong with having a __unicode__
method (I guess it would not be used in Python 3, but that is fine).
comment:13 Changed 3 years ago by
In src/sage/misc/sage_input.py
and six.string_types
, I would use six.string_types
instead of (str, six.text_type)
or [str, six.text_type]
.
For the docbuilder and related modules (like sageinspect.py
), maybe we should do that in a separate ticket and go unicode alltheway in that ticket.
comment:14 Changed 3 years ago by
 Commit changed from 687e6f040c64e23dc42ded6d11b485bdc520723f to f1d262a2cafc61a998c4ad9fcdba71d96f7a1a1d
comment:15 Changed 3 years ago by
 Commit changed from f1d262a2cafc61a998c4ad9fcdba71d96f7a1a1d to d1b11bf468779fde89856e0e565bfe0e4c1f3cc1
Branch pushed to git repo; I updated commit sha1. New commits:
d1b11bf  Merge branch 'public/16079' in 7.4.b1

comment:16 Changed 3 years ago by
 Status changed from needs_review to needs_work
comment:17 Changed 3 years ago by
 Milestone changed from sage7.4 to sage7.6
comment:18 Changed 2 years ago by
 Description modified (diff)
see #14153 for the documentation framework
The uprefix has been readded to python 3.3, so we don't have to care about it (now).