diff Lib/string.py @ 41440:cedc8d7d1c7f legacy-trunk

SF 1193128: Let str.translate(None) be an identity transformation
author Raymond Hettinger <python@rcn.com>
date Thu, 12 Apr 2007 04:10:00 +0000
parents 12c70558074e
children b7231bf6bfb7
line wrap: on
line diff
--- a/Lib/string.py	Wed Apr 11 23:28:44 2007 +0000
+++ b/Lib/string.py	Thu Apr 12 04:10:00 2007 +0000
@@ -487,7 +487,7 @@
     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,