Opened 6 years ago

Closed 6 years ago

#18554 closed enhancement (fixed)

Python 3 preparation: Most functions of module {{{string}}} are gone in Py3

Reported by: wluebbe Owned by:
Priority: major Milestone: sage-6.8
Component: misc Keywords: python3
Cc: Merged in:
Authors: Wilfried Luebbe Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 9407486 (Commits, GitHub, GitLab) Commit: 94074869966909d304fede5367627ead192add5d
Dependencies: Stopgaps:

Status badges

Description (last modified by wluebbe)

Use of string module functions like join() must be replaced by the corresponding string methods.

from string import join will fail. Those imports must be removed.

Uses like print(string.join(a_list) must be changed to print("".join(a_list).

The following functions are removed:

capitalize|center|count|expandtabs|find|index|join|
ljust|lower|lstrip|maketrans|replace|rfind|rindex|rjust|rsplit|
rstrip|split|strip|swapcase|translate|upper|zfill

This ticket is tracked as a dependency of meta-ticket ticket:15980.

Change History (11)

comment:1 Changed 6 years ago by wluebbe

  • Authors set to Wilfried Luebbe
  • Branch set to u/wluebbe/18554
  • Commit set to c937e392bbece486170d9582e6957b029d7b531a
  • Description modified (diff)
  • Keywords python3 added
  • Status changed from new to needs_review

New commits:

c937e39Trac #18533: Most functions of module string are gone in Py3

comment:2 Changed 6 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

LGTM. (I didn't even know such a module existed before this ticket; I had learned these as methods of strings.)

comment:3 Changed 6 years ago by aapitzsch

  • Status changed from positive_review to needs_work

You added trailing white space.

comment:4 Changed 6 years ago by git

  • Commit changed from c937e392bbece486170d9582e6957b029d7b531a to 96e7e157916af831b5cdc03752305a7993c5ae5f

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

96e7e15Removed trailing white space in 2 files.

comment:5 Changed 6 years ago by wluebbe

  • Status changed from needs_work to needs_review

comment:6 Changed 6 years ago by aapitzsch

  • Status changed from needs_review to positive_review

comment:7 Changed 6 years ago by vbraun

  • Status changed from positive_review to needs_work

Merge conflict, probably #18531

comment:8 Changed 6 years ago by wluebbe

Not quite surprising, but there was hope ... I am going to wait for 6.8.beta3.

comment:9 Changed 6 years ago by git

  • Commit changed from 96e7e157916af831b5cdc03752305a7993c5ae5f to 94074869966909d304fede5367627ead192add5d

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

9407486Merge branch 'develop' into u/wluebbe/18554

comment:10 Changed 6 years ago by wluebbe

  • Status changed from needs_work to positive_review

I merged with Sage-6.8.beta3 and successfully tested all-long. Therefore I changed the ticket again to positive-review.

comment:11 Changed 6 years ago by vbraun

  • Branch changed from u/wluebbe/18554 to 94074869966909d304fede5367627ead192add5d
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.