Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"".translate() docs should mention string.maketrans() #44211

Closed
salty-horse mannequin opened this issue Nov 8, 2006 · 5 comments
Closed

"".translate() docs should mention string.maketrans() #44211

salty-horse mannequin opened this issue Nov 8, 2006 · 5 comments
Assignees
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@salty-horse
Copy link
Mannequin

salty-horse mannequin commented Nov 8, 2006

BPO 1592899
Nosy @birkenfeld, @rhettinger, @salty-horse

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/rhettinger'
closed_at = <Date 2006-12-07.09:30:30.000>
created_at = <Date 2006-11-08.20:23:20.000>
labels = ['type-feature', 'docs']
title = '"".translate() docs should mention string.maketrans()'
updated_at = <Date 2006-12-07.09:30:30.000>
user = 'https://github.com/salty-horse'

bugs.python.org fields:

activity = <Date 2006-12-07.09:30:30.000>
actor = 'georg.brandl'
assignee = 'rhettinger'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2006-11-08.20:23:20.000>
creator = 'salty-horse'
dependencies = []
files = []
hgrepos = []
issue_num = 1592899
keywords = []
message_count = 5.0
messages = ['54935', '54936', '54937', '54938', '54939']
nosy_count = 4.0
nosy_names = ['effbot', 'georg.brandl', 'rhettinger', 'salty-horse']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue1592899'
versions = ['Python 2.6']

@salty-horse
Copy link
Mannequin Author

salty-horse mannequin commented Nov 8, 2006

The translate() documentation at
http://docs.python.org/lib/string-methods.html#l2h-268
should mention the string.maketrans helper function.

maketrans also mentions "regex.compile" - that should
probably be "re.compile" (although it's less readable).

re.compile should mention maketrans as well.

@salty-horse salty-horse mannequin closed this as completed Nov 8, 2006
@salty-horse salty-horse mannequin assigned rhettinger Nov 8, 2006
@salty-horse salty-horse mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Nov 8, 2006
@salty-horse salty-horse mannequin closed this as completed Nov 8, 2006
@salty-horse salty-horse mannequin assigned rhettinger Nov 8, 2006
@salty-horse salty-horse mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Nov 8, 2006
@effbot
Copy link
Mannequin

effbot mannequin commented Dec 4, 2006

"re.compile should mention maketrans as well"

why?

@salty-horse
Copy link
Mannequin Author

salty-horse mannequin commented Dec 4, 2006

"re.compile should mention maketrans as well"
why?

The maketrans doc says:
"Return a translation table suitable for passing to translate() or regex.compile()"

I don't have any use case for how it's useful to regex.compile. Maybe there is none, and the mention can be removed.

@effbot
Copy link
Mannequin

effbot mannequin commented Dec 4, 2006

Aha. The regex documentation says:

compile (pattern[, translate]) /.../ The optional argument translate, if present, must be a 256-character string indicating how characters (both of the pattern and of the strings to be matched) are translated before comparing them; the i-th element of the string gives the translation for the character with ASCII code i. This can be used to implement case-insensitive matching; see the casefold data item below.

which means that it was indeed useful for regex.compile. afaik, re.compile doesn't support arbitrary mappings, so that reference should be removed.

@birkenfeld
Copy link
Member

Cleared up both items in rev. 52951, 52952 (2.5).

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants