Issue 12164: str.translate docstring doesn't mention that 'table' can be None (original) (raw)

Created on 2011-05-24 05:14 by mark.dickinson, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
str_translate_docstring.patch petri.lehtinen,2011-05-26 06:49 Fix docstring of str.translate
str_translate_docstring_2.patch petri.lehtinen,2011-05-31 11:01 Different wording
Messages (6)
msg136720 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2011-05-24 05:14
In Python 2.6 and 2.7, str.translate accepts None as a first argument. That's documented in the docs, but not in the str.translate docstring.
msg137353 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-05-31 09:45
I added a patch a few days ago. How does it look?
msg137356 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-05-31 11:01
After discussing with Ezio Melotti, I attached another patch with a different wording. Mark: As a native English speaker, which one you prefer?
msg137645 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2011-06-04 14:54
Thanks for the patches! Here's a slight expansion of the wording on your second patch: Return a copy of the string S, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256 or None. If the table argument is None, no translation is applied and the translation simply removes the characters in deletechars. What do you think?
msg137657 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-06-04 18:08
> What do you think? Sounds very good to my native Finnish ears :)
msg139028 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-06-25 09:00
New changeset 60b3a5615c4e by Mark Dickinson in branch '2.7': Issue #12164: Document (in docstring) that str.translate accepts None for the first argument. http://hg.python.org/cpython/rev/60b3a5615c4e
History
Date User Action Args
2022-04-11 14:57:17 admin set github: 56373
2011-06-25 09:01:08 mark.dickinson set status: open -> closedresolution: accepted -> fixed
2011-06-25 09:00:19 python-dev set nosy: + python-devmessages: +
2011-06-04 18:21:34 rhettinger set resolution: accepted
2011-06-04 18:08:50 petri.lehtinen set messages: +
2011-06-04 14:54:44 mark.dickinson set assignee: docs@python -> mark.dickinsonmessages: +
2011-05-31 11:01:36 petri.lehtinen set files: + str_translate_docstring_2.patchmessages: +
2011-05-31 09:45:42 petri.lehtinen set messages: +
2011-05-26 06:49:53 petri.lehtinen set files: + str_translate_docstring.patchnosy: + petri.lehtinenkeywords: + patch
2011-05-24 05:14:44 mark.dickinson create