This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: add str.maketrans()
Type: behavior Stage:
Components: Versions: Python 3.0
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, gvanrossum
Priority: normal Keywords: patch

Created on 2007-11-25 01:24 by georg.brandl, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
str-maketrans.diff georg.brandl, 2007-11-25 01:24
Messages (4)
msg57823 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-11-25 01:24
This patch restores old behavior of str.translate() and adds the
str.maketrans() static method. Docs and tests will follow if this is the
right way to go.
msg57838 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-11-26 04:22
Looks good from a functionality POV.

I wonder if we couldn't change the dict though to always map ordinals to
strings?  Deletions can be mapped to "".  We could warn about non-string
values in the 2.6 version of this code, and make it a (lazy) error in 3.0.
msg57849 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-11-26 19:08
BTW I'm okay with submitting this as is (plus docs and tests) and
tighten the spec later.
msg57898 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-11-27 23:48
Okay, checked in as r59205.
History
Date User Action Args
2022-04-11 14:56:28adminsetgithub: 45837
2008-01-06 22:29:44adminsetkeywords: - py3k
versions: Python 3.0
2007-11-27 23:48:29georg.brandlsetstatus: open -> closed
resolution: accepted
messages: + msg57898
2007-11-26 19:08:40gvanrossumsetkeywords: + py3k, patch
assignee: gvanrossum -> georg.brandl
messages: + msg57849
2007-11-26 04:22:08gvanrossumsetmessages: + msg57838
2007-11-25 01:24:45georg.brandlcreate