Opened 6 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!)
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:  Commit:  
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 (29)
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
comment:19 Changed 2 years ago by
 Milestone changed from sage7.6 to sage8.0
comment:20 Changed 2 years ago by
 Commit changed from d1b11bf468779fde89856e0e565bfe0e4c1f3cc1 to 3041cc6de7dc8c0aa8b2a5eb4d8e0d16b6e0eeb0
Branch pushed to git repo; I updated commit sha1. New commits:
3041cc6  Merge branch 'public/16079' in 8.0.b4

comment:21 Changed 2 years ago by
see #22916 for a preliminary tiny step
comment:22 Changed 2 years ago by
 Keywords unicode added
comment:23 Changed 2 years ago by
 Commit changed from 3041cc6de7dc8c0aa8b2a5eb4d8e0d16b6e0eeb0 to 151118403119dfc3a513b2abeca8dbfe9a2f31c7
Branch pushed to git repo; I updated commit sha1. New commits:
1511184  Merge branch 'public/16079' in 8.0.b11

comment:24 Changed 2 years ago by
 Commit changed from 151118403119dfc3a513b2abeca8dbfe9a2f31c7 to 53da6fd9725b455c0e47b5f383c003e656f0dbc6
Branch pushed to git repo; I updated commit sha1. New commits:
53da6fd  trac 16079 some details

comment:25 Changed 2 years ago by
 Commit changed from 53da6fd9725b455c0e47b5f383c003e656f0dbc6 to 42ccdbc87b175674032d3250a06d68c76675dc76
Branch pushed to git repo; I updated commit sha1. New commits:
42ccdbc  Merge branch 'public/16079' in 8.1.b3

comment:26 Changed 2 years ago by
 Commit changed from 42ccdbc87b175674032d3250a06d68c76675dc76 to 67a2c98782b2d7a975ea1916a3a586e6f9ad0697
Branch pushed to git repo; I updated commit sha1. New commits:
67a2c98  oops

comment:27 Changed 2 years ago by
 Commit changed from 67a2c98782b2d7a975ea1916a3a586e6f9ad0697 to 665824e4b65c2ca8a49ec666cf9d27c1f03e12bb
Branch pushed to git repo; I updated commit sha1. New commits:
665824e  Merge branch 'public/16079' in 8.1.b8

comment:28 Changed 2 years ago by
I have created a new ticket that just wants to introduce the conversion tools: #24186.
comment:29 Changed 4 months ago by
 Branch public/16079 deleted
 Commit 665824e4b65c2ca8a49ec666cf9d27c1f03e12bb deleted
The uprefix has been readded to python 3.3, so we don't have to care about it (now).