From 5357c6511dcac17e1c80dbdeaea6c1016f44f4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 14 Oct 2002 20:03:40 +0000 Subject: Convert empty string literal to string. Speed up creation of idmap. --- Lib/string.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Lib/string.py') diff --git a/Lib/string.py b/Lib/string.py index 1d452edf95..ec796f63ad 100644 --- a/Lib/string.py +++ b/Lib/string.py @@ -34,9 +34,10 @@ punctuation = """!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~""" printable = digits + letters + punctuation + whitespace # Case conversion helpers -_idmap = '' -for i in range(256): _idmap = _idmap + chr(i) -del i +# Use str to convert Unicode literal in case of -U +l = map(chr, xrange(256)) +_idmap = str('').join(l) +del l # Backward compatible names for exceptions index_error = ValueError -- cgit v1.2.1