diff options
author | Raymond Hettinger <python@rcn.com> | 2007-04-12 04:10:00 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2007-04-12 04:10:00 +0000 |
commit | ae61c036d9a8cbf2776823ba66c2c15cb423b140 (patch) | |
tree | 3bc2b7d4cdefa96d734e10a5c6838d8ecd8af178 /Lib/string.py | |
parent | e1cd539dddf7cc9f6c0195385bcec88bc69823f7 (diff) | |
download | cpython-ae61c036d9a8cbf2776823ba66c2c15cb423b140.tar.gz |
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 921bd8b1d0..9e3cc418ef 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, |