diff options
author | Raymond Hettinger <python@rcn.com> | 2007-04-12 04:10:00 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2007-04-12 04:10:00 (GMT) |
commit | 4db5fe970c695c373c59ac7152eb07b07249b0b5 (patch) | |
tree | b245934756e45a1dbc07fae5a07481373e560106 /Lib/string.py | |
parent | 51761806105a4cc2f58325f46a6d33c8144ad617 (diff) | |
download | cpython-4db5fe970c695c373c59ac7152eb07b07249b0b5.zip cpython-4db5fe970c695c373c59ac7152eb07b07249b0b5.tar.gz cpython-4db5fe970c695c373c59ac7152eb07b07249b0b5.tar.bz2 |
SF 1193128: Let str.translate(None) be an identity transformation
Diffstat (limited to 'Lib/string.py')
-rw-r--r-- | Lib/string.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/string.py b/Lib/string.py index 921bd8b..9e3cc41 100644 --- a/Lib/string.py +++ b/Lib/string.py @@ -487,7 +487,7 @@ def translate(s, table, deletions=""): deletions argument is not allowed for Unicode strings. """ - if deletions: + if deletions or table is None: return s.translate(table, deletions) else: # Add s[:0] so that if s is Unicode and table is an 8-bit string, |