Opened 5 years ago

Last modified 7 weeks 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: sage-8.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 chapoton)

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 u-prefix 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 meta-ticket #16052.

Change History (29)

comment:1 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:2 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:3 Changed 4 years ago by aapitzsch

  • Authors set to André Apitzsch
  • Branch set to u/aapitzsch/ticket/16079
  • Commit set to a4e66492ce638d515a42f9da9d2a68aae3b382bc
  • Status changed from new to needs_review

The u-prefix has been readded to python 3.3, so we don't have to care about it (now).

comment:4 Changed 4 years ago by chapoton

  • Status changed from needs_review to needs_work

this breaks the doc building, see patchbot report

comment:5 Changed 3 years ago by chapoton

  • Component changed from distribution to python3
  • Milestone changed from sage-6.4 to sage-7.2

comment:6 Changed 3 years ago by chapoton

  • Branch changed from u/aapitzsch/ticket/16079 to public/16079
  • Commit changed from a4e66492ce638d515a42f9da9d2a68aae3b382bc to e1344bd7a167c30e6e7d3659eff70ebbc023a4b6

New commits:

e1344bdMerge branch 'u/aapitzsch/ticket/16079' into 7.2.rc2

comment:7 Changed 3 years ago by git

  • Commit changed from e1344bd7a167c30e6e7d3659eff70ebbc023a4b6 to e6b9d7cedb213a34f5aa4b6f8fd7a3166fc2a9cb

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

9bdb4baMerge branch 'public/16079' into 7.3.b5
e6b9d7ctrac 16079 remove a decorator in pyx file

comment:8 Changed 3 years ago by git

  • Commit changed from e6b9d7cedb213a34f5aa4b6f8fd7a3166fc2a9cb to a59b4a17bc353c842050a1fe217fae6035de6648

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

1561febMerge branch 'public/16079' in 7.3.rc0
a59b4a1trac 16079 using six.text_type

comment:9 Changed 3 years ago by git

  • Commit changed from a59b4a17bc353c842050a1fe217fae6035de6648 to 687e6f040c64e23dc42ded6d11b485bdc520723f

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

687e6f0trac 16079 using six.tex_type in docbuilding

comment:10 Changed 3 years ago by chapoton

  • Milestone changed from sage-7.2 to sage-7.4

comment:11 Changed 3 years ago by chapoton

  • 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 jdemeyer

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 jdemeyer

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 all-the-way in that ticket.

comment:14 Changed 3 years ago by git

  • Commit changed from 687e6f040c64e23dc42ded6d11b485bdc520723f to f1d262a2cafc61a998c4ad9fcdba71d96f7a1a1d

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

06e55abMerge branch 'public/16079' in 7.4.b0
f1d262atrac 16079 reviewer's comments

comment:15 Changed 3 years ago by git

  • Commit changed from f1d262a2cafc61a998c4ad9fcdba71d96f7a1a1d to d1b11bf468779fde89856e0e565bfe0e4c1f3cc1

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

d1b11bfMerge branch 'public/16079' in 7.4.b1

comment:16 Changed 3 years ago by chapoton

  • Status changed from needs_review to needs_work

comment:17 Changed 3 years ago by chapoton

  • Milestone changed from sage-7.4 to sage-7.6

comment:18 Changed 2 years ago by chapoton

  • Description modified (diff)

see #14153 for the documentation framework

comment:19 Changed 2 years ago by chapoton

  • Milestone changed from sage-7.6 to sage-8.0

comment:20 Changed 2 years ago by git

  • Commit changed from d1b11bf468779fde89856e0e565bfe0e4c1f3cc1 to 3041cc6de7dc8c0aa8b2a5eb4d8e0d16b6e0eeb0

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

3041cc6Merge branch 'public/16079' in 8.0.b4

comment:21 Changed 2 years ago by chapoton

see #22916 for a preliminary tiny step

comment:22 Changed 2 years ago by chapoton

  • Keywords unicode added

comment:23 Changed 2 years ago by git

  • Commit changed from 3041cc6de7dc8c0aa8b2a5eb4d8e0d16b6e0eeb0 to 151118403119dfc3a513b2abeca8dbfe9a2f31c7

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

1511184Merge branch 'public/16079' in 8.0.b11

comment:24 Changed 2 years ago by git

  • Commit changed from 151118403119dfc3a513b2abeca8dbfe9a2f31c7 to 53da6fd9725b455c0e47b5f383c003e656f0dbc6

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

53da6fdtrac 16079 some details

comment:25 Changed 23 months ago by git

  • Commit changed from 53da6fd9725b455c0e47b5f383c003e656f0dbc6 to 42ccdbc87b175674032d3250a06d68c76675dc76

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

42ccdbcMerge branch 'public/16079' in 8.1.b3

comment:26 Changed 23 months ago by git

  • Commit changed from 42ccdbc87b175674032d3250a06d68c76675dc76 to 67a2c98782b2d7a975ea1916a3a586e6f9ad0697

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

67a2c98oops

comment:27 Changed 21 months ago by git

  • Commit changed from 67a2c98782b2d7a975ea1916a3a586e6f9ad0697 to 665824e4b65c2ca8a49ec666cf9d27c1f03e12bb

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

665824eMerge branch 'public/16079' in 8.1.b8

comment:28 Changed 21 months ago by chapoton

I have created a new ticket that just wants to introduce the conversion tools: #24186.

comment:29 Changed 7 weeks ago by chapoton

  • Branch public/16079 deleted
  • Commit 665824e4b65c2ca8a49ec666cf9d27c1f03e12bb deleted
Note: See TracTickets for help on using tickets.